CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::RendererEnvironment Class Referenceabstract

A class that represents a environment inside the renderer. More...

#include <CeresEngine/Renderer/RendererEnvironment.hpp>

Inheritance diagram for CeresEngine::RendererEnvironment:
CeresEngine::TRendererSceneObject< RendererEnvironment > CeresEngine::TRendererObject< SelfType, BaseType > CeresEngine::RendererObject CeresEngine::RendererSkyboxEnvironment

Public Member Functions

 RendererEnvironment (RendererEnvironmentManager &manager, RendererScene &scene)
 Creates a new RendererEnvironment.
 
virtual ~RendererEnvironment ()
 Destroys the renderer environment and releases any renderer (and RenderAPI)-related resources.
 
void synchronize (const EnvironmentComponent &component)
 Update the renderer environment with data from a transform and the component.
 
virtual void prepare (RendererContext &context)
 Prepares the environment for the rendering of the current frame.
 
virtual const GPUUniformBuffergetUniformBuffer () const =0
 The uniform buffer storing the environment GPU parameters used by the renderer.
 
virtual RendererEnvironmentType getType () const noexcept=0
 Determines the type of environment.
 
const RendererEnvironmentDirtyFlagsgetDirtyFlags () const noexcept
 A set of flags that represent the dirty portions of the object.
 
bool isDirty () const noexcept
 
void markAsDirty (const RendererEnvironmentDirtyFlags &flags=RendererEnvironmentDirtyFlag::All) noexcept
 
- Public Member Functions inherited from CeresEngine::TRendererSceneObject< RendererEnvironment >
 TRendererSceneObject (Args &&... args)
 Creates a new TRendererSceneObject instance.
 
 ~TRendererSceneObject () noexcept override
 Destroys an existing TRendererSceneObject instance.
 
- Public Member Functions inherited from CeresEngine::TRendererObject< SelfType, BaseType >
template<typename... Args>
 TRendererObject (ManagerType &manager, Args &&... args)
 Creates a new TRendererObject instance.
 
void destroy () noexcept override
 Destroys the RendererObject.
 
ManagerTypegetManager () const noexcept
 The owning object manager.
 
- Public Member Functions inherited from CeresEngine::RendererObject
 RendererObject ()=default
 Creates a new RendererObject instance.
 
virtual ~RendererObject () noexcept=default
 Destroys an existing RendererObject instance.
 
RendererObjectID getID () const noexcept
 An identifier that uniquely identifies this object in the renderer.
 

Protected Member Functions

GPUImagePtr equirectangularToCubeMap (RendererContext &context, const GPUImagePtr &environmentMap)
 
GPUImagePtr prefilterIrradianceMap (RendererContext &context, const GPUImagePtr &environmentMap)
 Generates a diffuse irradiance map for the given environmentMap.
 
GPUImagePtr prefilterRadianceMap (RendererContext &context, const GPUImagePtr &environmentMap)
 Generates a specular pre-filtered reflection map using environmentMap as a base.
 

Protected Attributes

EnvironmentComponent mComponent
 A copy of the latest environment component.
 
RendererEnvironmentDirtyFlags mDirtyFlags = RendererEnvironmentDirtyFlag::All
 A set of flags that represent the dirty portions of the object.
 
- Protected Attributes inherited from CeresEngine::TRendererObject< SelfType, BaseType >
ManagerTypemManager
 The owning object manager.
 
- Protected Attributes inherited from CeresEngine::RendererObject
RendererObjectID mID
 An identifier that uniquely identifies this object in the renderer.
 

Private Types

using super = TRendererSceneObject< RendererEnvironment >
 

Friends

class RendererEnvironmentManager
 

Additional Inherited Members

- Public Attributes inherited from CeresEngine::RendererObject
Event< void(RendererObjectID newID)> willChangeID
 An event called whenever the object is about to change it's ID.
 
Event< void(RendererObjectID oldID)> didChangeID
 An event called whenever the object changes it's ID.
 

Detailed Description

A class that represents a environment inside the renderer.

The environment can be either captured during runtime or stored in a texture.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ RendererEnvironment()

CeresEngine::RendererEnvironment::RendererEnvironment ( RendererEnvironmentManager manager,
RendererScene scene 
)
explicit

Creates a new RendererEnvironment.

Parameters
managerThe owning manager.
sceneA reference to the owning scene.

◆ ~RendererEnvironment()

virtual CeresEngine::RendererEnvironment::~RendererEnvironment ( )
virtual

Destroys the renderer environment and releases any renderer (and RenderAPI)-related resources.

Member Function Documentation

◆ equirectangularToCubeMap()

GPUImagePtr CeresEngine::RendererEnvironment::equirectangularToCubeMap ( RendererContext context,
const GPUImagePtr environmentMap 
)
protected

◆ getDirtyFlags()

const RendererEnvironmentDirtyFlags & CeresEngine::RendererEnvironment::getDirtyFlags ( ) const
inlinenoexcept

A set of flags that represent the dirty portions of the object.

◆ getType()

virtual RendererEnvironmentType CeresEngine::RendererEnvironment::getType ( ) const
pure virtualnoexcept

Determines the type of environment.

Implemented in CeresEngine::RendererSkyboxEnvironment.

◆ getUniformBuffer()

virtual const GPUUniformBuffer & CeresEngine::RendererEnvironment::getUniformBuffer ( ) const
pure virtual

The uniform buffer storing the environment GPU parameters used by the renderer.

Implemented in CeresEngine::RendererSkyboxEnvironment.

◆ isDirty()

bool CeresEngine::RendererEnvironment::isDirty ( ) const
inlinenoexcept

◆ markAsDirty()

void CeresEngine::RendererEnvironment::markAsDirty ( const RendererEnvironmentDirtyFlags flags = RendererEnvironmentDirtyFlag::All)
noexcept

◆ prefilterIrradianceMap()

GPUImagePtr CeresEngine::RendererEnvironment::prefilterIrradianceMap ( RendererContext context,
const GPUImagePtr environmentMap 
)
protected

Generates a diffuse irradiance map for the given environmentMap.

Parameters
contextThe renderer context to execute the irradiance map generation on.
environmentMapThe environment map to be used as a base to generate the irradiance map.
Returns
A newly created GPU Image that contains the irradiance map.

◆ prefilterRadianceMap()

GPUImagePtr CeresEngine::RendererEnvironment::prefilterRadianceMap ( RendererContext context,
const GPUImagePtr environmentMap 
)
protected

Generates a specular pre-filtered reflection map using environmentMap as a base.

Parameters
contextThe renderer context to execute the prefiltered map generation on.
environmentMapThe environment map to be used as a base to generate the pre-filtered reflection map.
Returns
A newly created GPU Image that contains the pre-filtered reflection map.

◆ prepare()

virtual void CeresEngine::RendererEnvironment::prepare ( RendererContext context)
virtual

Prepares the environment for the rendering of the current frame.

This will update uniform buffers and perform any other necessary operations necessary for rendering.

Parameters
contextA context struct that contains parameters given by the renderer.

Reimplemented in CeresEngine::RendererSkyboxEnvironment.

◆ synchronize()

void CeresEngine::RendererEnvironment::synchronize ( const EnvironmentComponent component)

Update the renderer environment with data from a transform and the component.

Note
This method is usually called from RenderingSystem during a synchronization point.
Parameters
transformThe environment transform.
componentThe environment component.

Friends And Related Symbol Documentation

◆ RendererEnvironmentManager

Member Data Documentation

◆ mComponent

EnvironmentComponent CeresEngine::RendererEnvironment::mComponent
protected

A copy of the latest environment component.

◆ mDirtyFlags

RendererEnvironmentDirtyFlags CeresEngine::RendererEnvironment::mDirtyFlags = RendererEnvironmentDirtyFlag::All
protected

A set of flags that represent the dirty portions of the object.


The documentation for this class was generated from the following file: