CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::RendererLight Class Referencefinal

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

#include <CeresEngine/Renderer/RendererLight.hpp>

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

Public Member Functions

 RendererLight (RendererLightManager &manager, RendererScene &scene)
 Creates a new RendererLight.
 
 ~RendererLight () noexcept final
 Destroys the renderer light and releases any renderer (and RenderAPI)-related resources.
 
void synchronize (const Transform &transform, const LightComponent &component)
 Update the renderer light with data from a transform and the component.
 
void prepare (RendererContext &context)
 Prepares the light for the rendering of the current frame.
 
void renderShadow (GPUCommandBuffer &commandBuffer)
 
LightComponent getComponent () const
 A copy of the latest light component.
 
const RendererLightSettingsgetSettings () const
 
const RendererLightFlagsgetFlags () const noexcept
 A set of flags that customize and represent the state of the object.
 
void setFlags (const RendererLightFlags &flags)
 A set of flags that customize and represent the state of the object.
 
const RendererLightDirtyFlagsgetDirtyFlags () const noexcept
 A set of flags that represent the dirty portions of the object.
 
bool isDirty () const noexcept
 If set to true, the light is dirty and needs to be synchronized from the entity.
 
void markAsDirty (const RendererLightDirtyFlags &flags=RendererLightDirtyFlag::All) noexcept
 If set to true, the light is dirty and needs to be synchronized from the entity.
 
const RendererLightInfogetInfo () const
 A structure that holds renderer-specific information for the light.
 
RendererLightInfogetInfo ()
 A structure that holds renderer-specific information for the light.
 
const GPUBindlessBuffergetUniformBuffer () const
 The uniform buffer storing the light GPU parameters used by the renderer.
 
Sphere getBoundingSphere () const
 Gets the renderable bounding sphere.
 
const GPUImagePtrgetShadowMap () const
 A device image that holds the rendered shadow map.
 
void setShadowMap (const GPUImagePtr &shadowMap)
 A device image that holds the rendered shadow map.
 
- Public Member Functions inherited from CeresEngine::TRendererSceneObject< RendererLight >
 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.
 

Private Types

using super = TRendererSceneObject< RendererLight >
 

Private Attributes

LightComponent mComponent
 A copy of the latest light component.
 
RendererLightFlags mFlags
 A set of flags that customize and represent the state of the object.
 
RendererLightDirtyFlags mDirtyFlags = RendererLightDirtyFlag::All
 A set of flags that represent the dirty portions of the object.
 
bool mDirty = true
 If set to true, the light is dirty and needs to be synchronized from the entity.
 
RendererLightInfo mInfo
 A structure that holds renderer-specific information for the light.
 
RendererLightParams mParameters
 The GPU parameters. Will be copied to the GPU uniform buffer.
 
GPUDynamicBindlessBuffer< RendererLightParamsmUniformBuffer
 The uniform buffer storing the light GPU parameters used by the renderer.
 
GPUImagePtr mShadowMap = nullptr
 A device image that holds the rendered shadow map.
 

Friends

class RendererLightManager
 

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.
 
- 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.
 

Detailed Description

A class that represents a light inside the renderer.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ RendererLight()

CeresEngine::RendererLight::RendererLight ( RendererLightManager manager,
RendererScene scene 
)
explicit

Creates a new RendererLight.

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

◆ ~RendererLight()

CeresEngine::RendererLight::~RendererLight ( )
finalnoexcept

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

Member Function Documentation

◆ getBoundingSphere()

Sphere CeresEngine::RendererLight::getBoundingSphere ( ) const

Gets the renderable bounding sphere.

◆ getComponent()

LightComponent CeresEngine::RendererLight::getComponent ( ) const
inline

A copy of the latest light component.

◆ getDirtyFlags()

const RendererLightDirtyFlags & CeresEngine::RendererLight::getDirtyFlags ( ) const
inlinenoexcept

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

◆ getFlags()

const RendererLightFlags & CeresEngine::RendererLight::getFlags ( ) const
inlinenoexcept

A set of flags that customize and represent the state of the object.

◆ getInfo() [1/2]

RendererLightInfo & CeresEngine::RendererLight::getInfo ( )
inline

A structure that holds renderer-specific information for the light.

◆ getInfo() [2/2]

const RendererLightInfo & CeresEngine::RendererLight::getInfo ( ) const
inline

A structure that holds renderer-specific information for the light.

◆ getSettings()

const RendererLightSettings & CeresEngine::RendererLight::getSettings ( ) const
inline

◆ getShadowMap()

const GPUImagePtr & CeresEngine::RendererLight::getShadowMap ( ) const
inline

A device image that holds the rendered shadow map.

◆ getUniformBuffer()

const GPUBindlessBuffer & CeresEngine::RendererLight::getUniformBuffer ( ) const
inline

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

◆ isDirty()

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

If set to true, the light is dirty and needs to be synchronized from the entity.

◆ markAsDirty()

void CeresEngine::RendererLight::markAsDirty ( const RendererLightDirtyFlags flags = RendererLightDirtyFlag::All)
noexcept

If set to true, the light is dirty and needs to be synchronized from the entity.

◆ prepare()

void CeresEngine::RendererLight::prepare ( RendererContext context)

Prepares the light for the rendering of the current frame.

This will update uniform buffers and perform any other necessary operations necessary for rendering. All prepared data must be view independent.

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

◆ renderShadow()

void CeresEngine::RendererLight::renderShadow ( GPUCommandBuffer commandBuffer)

◆ setFlags()

void CeresEngine::RendererLight::setFlags ( const RendererLightFlags flags)

A set of flags that customize and represent the state of the object.

◆ setShadowMap()

void CeresEngine::RendererLight::setShadowMap ( const GPUImagePtr shadowMap)

A device image that holds the rendered shadow map.

◆ synchronize()

void CeresEngine::RendererLight::synchronize ( const Transform transform,
const LightComponent component 
)

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

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

Friends And Related Symbol Documentation

◆ RendererLightManager

Member Data Documentation

◆ mComponent

LightComponent CeresEngine::RendererLight::mComponent
private

A copy of the latest light component.

◆ mDirty

bool CeresEngine::RendererLight::mDirty = true
private

If set to true, the light is dirty and needs to be synchronized from the entity.

◆ mDirtyFlags

RendererLightDirtyFlags CeresEngine::RendererLight::mDirtyFlags = RendererLightDirtyFlag::All
private

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

◆ mFlags

RendererLightFlags CeresEngine::RendererLight::mFlags
private

A set of flags that customize and represent the state of the object.

◆ mInfo

RendererLightInfo CeresEngine::RendererLight::mInfo
private

A structure that holds renderer-specific information for the light.

◆ mParameters

RendererLightParams CeresEngine::RendererLight::mParameters
private

The GPU parameters. Will be copied to the GPU uniform buffer.

◆ mShadowMap

GPUImagePtr CeresEngine::RendererLight::mShadowMap = nullptr
private

A device image that holds the rendered shadow map.

◆ mUniformBuffer

GPUDynamicBindlessBuffer<RendererLightParams> CeresEngine::RendererLight::mUniformBuffer
private

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


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