Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Public Attributes | Protected Attributes | List of all members
castor3d::Light Class Reference

#include <Light.hpp>

Inheritance diagram for castor3d::Light:
Inheritance graph
[legend]
Collaboration diagram for castor3d::Light:
Collaboration graph
[legend]

Public Member Functions

C3D_API Light (castor::String const &name, Scene &scene, SceneNode &node, LightFactory &factory, LightType lightType)
 Constructor.
 
C3D_API void update (CpuUpdater &updater)
 CPU Update.
 
C3D_API void fillLightBuffer (uint32_t index, VkDeviceSize offset, castor::Point4f *data)
 Records the light data into given buffer.
 
C3D_API void fillShadowBuffer (AllShadowData &data)
 Records the light data into given buffer.
 
C3D_API void accept (ConfigurationVisitorBase &vis)
 ConfigurationVisitorBase acceptance function.
 
C3D_API DirectionalLightRPtr getDirectionalLight () const
 
C3D_API PointLightRPtr getPointLight () const
 
C3D_API SpotLightRPtr getSpotLight () const
 
LightType getLightType () const
 
uint32_t getLightComponentCount () const
 
uint32_t getShadowComponentCount () const
 
bool isEnabled () const
 
castor::Point3f const & getColour () const
 
castor::Point2f const & getIntensity () const
 
float getFarPlane () const
 
float getDiffuseIntensity () const
 
float getSpecularIntensity () const
 
castor::BoundingBox const & getBoundingBox () const
 
LightCategoryRPtr getCategory () const
 
bool isShadowProducer () const
 
bool isExpectedShadowProducer () const
 
ShadowType getShadowType () const
 
ShadowMapRPtr getShadowMap () const
 
int32_t getShadowMapIndex () const
 
uint32_t getBufferIndex () const
 
VkDeviceSize getBufferOffset () const
 
bool needsRsmShadowMaps () const
 
GlobalIlluminationType getGlobalIlluminationType () const
 
GlobalIlluminationType getExpectedGlobalIlluminationType () const
 
LpvConfig const & getLpvConfig () const
 
LpvConfiggetLpvConfig ()
 
uint32_t getVolumetricSteps () const
 
float getVolumetricScatteringFactor () const
 
castor::Point2f const & getShadowRawOffsets () const
 
castor::Point2f const & getShadowPcfOffsets () const
 
float getVsmMinVariance () const
 
float getVsmLightBleedingReduction () const
 
castor::RangedValue< uint32_t > getShadowPcfFilterSize () const
 
castor::RangedValue< uint32_t > getShadowPcfSampleCount () const
 
ShadowConfig const & getShadowConfig () const
 
ShadowConfiggetShadowConfig ()
 
void setColour (float const *values)
 
void setColour (float r, float g, float b)
 
void setColour (castor::Point3f const &value)
 
void setColour (castor::RgbColour const &value)
 
void setIntensity (float const *values)
 
void setIntensity (float d, float s)
 
void setIntensity (castor::Point2f const &value)
 
void setDiffuseIntensity (float value)
 
void setSpecularIntensity (float value)
 
void setEnabled (bool value)
 
void enable ()
 
void disable ()
 
void setShadowConfig (ShadowConfig config)
 
void setShadowMapIndex (int32_t index)
 
void setShadowMap (ShadowMapRPtr value, int32_t index=-1)
 
void setGlobalIlluminationType (GlobalIlluminationType value)
 
void setShadowType (ShadowType value)
 
void setVolumetricSteps (uint32_t value)
 
void setVolumetricScatteringFactor (float value)
 
void setRawMinOffset (float value)
 
void setRawMaxSlopeOffset (float value)
 
void setPcfMinOffset (float value)
 
void setPcfMaxSlopeOffset (float value)
 
void setPcfFilterSize (uint32_t value)
 
void setPcfSampleCount (uint32_t value)
 
void setVsmMinVariance (float value)
 
void setVsmLightBleedingReduction (float value)
 
- Public Member Functions inherited from castor3d::MovableObject
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type, SceneNode &node)
 Constructor.
 
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type)
 Constructor.
 
virtual C3D_API ~MovableObject () noexcept
 Destructor.
 
C3D_API void detach ()
 Detaches the movable object from it's parent.
 
virtual C3D_API void attachTo (SceneNode &node)
 Attaches the movable object to a node.
 
C3D_API void markDirty ()
 Adds the object to dirty object list in the scene.
 
C3D_API EngineRPtr getEngine () const noexcept
 
SceneNodegetParent () const noexcept
 
MovableType getMovableType () const noexcept
 
- Public Member Functions inherited from castor::OwnedBy< Scene >
Scene * getOwner () const
 
- Public Member Functions inherited from castor::NamedBaseT< T >
 NamedBaseT (T name) noexcept
 Constructor.
 
T const & getName () const noexcept
 Retrieves the name.
 
void rename (T name) noexcept
 

Public Attributes

OnLightChanged onGPUChanged
 

Protected Attributes

bool m_enabled {}
 
std::atomic_bool m_currentShadowCaster {}
 
bool m_dirty { true }
 
ShadowConfig m_shadows
 
LightCategoryUPtr m_category
 
ShadowMapRPtr m_shadowMap {}
 
int32_t m_shadowMapIndex { -1 }
 
std::atomic< GlobalIlluminationTypem_currentGlobalIllumination {}
 
uint32_t m_bufferIndex { InvalidIndex }
 
VkDeviceSize m_bufferOffset {}
 
- Protected Attributes inherited from castor3d::MovableObject
MovableType m_type
 
SceneNodem_sceneNode {}
 
OnSceneNodeChangedConnection m_notifyIndex
 
- Protected Attributes inherited from castor::NamedBaseT< T >
m_name
 

Additional Inherited Members

- Protected Member Functions inherited from castor::OwnedBy< Scene >
 OwnedBy (Scene &owner)
 Constructor.
 

Constructor & Destructor Documentation

◆ Light()

C3D_API castor3d::Light::Light ( castor::String const & name,
Scene & scene,
SceneNode & node,
LightFactory & factory,
LightType lightType )

Constructor.

Parameters
[in]nameThe light name.
[in]sceneParent scene.
[in]nodeThe parent scene node.
[in]factoryFactory used to create the LightCategory.
[in]lightTypeThe light type.

Member Function Documentation

◆ accept()

C3D_API void castor3d::Light::accept ( ConfigurationVisitorBase & vis)

ConfigurationVisitorBase acceptance function.

Parameters
visThe ... visitor.

◆ disable()

void castor3d::Light::disable ( )
inline

References setEnabled().

Here is the call graph for this function:

◆ enable()

void castor3d::Light::enable ( )
inline

References setEnabled().

Here is the call graph for this function:

◆ fillLightBuffer()

C3D_API void castor3d::Light::fillLightBuffer ( uint32_t index,
VkDeviceSize offset,
castor::Point4f * data )

Records the light data into given buffer.

Parameters
[in]indexThe light index in the buffer.
[in]offsetThe light data offset in the buffer.
[out]dataReceives the informations.

◆ fillShadowBuffer()

C3D_API void castor3d::Light::fillShadowBuffer ( AllShadowData & data)

Records the light data into given buffer.

Parameters
[out]dataReceives the informations.

◆ getBoundingBox()

castor::BoundingBox const & castor3d::Light::getBoundingBox ( ) const
inline

References m_category.

◆ getBufferIndex()

uint32_t castor3d::Light::getBufferIndex ( ) const
inline

References m_bufferIndex.

◆ getBufferOffset()

VkDeviceSize castor3d::Light::getBufferOffset ( ) const
inline

References m_bufferOffset.

◆ getCategory()

LightCategoryRPtr castor3d::Light::getCategory ( ) const
inline

References m_category.

◆ getColour()

castor::Point3f const & castor3d::Light::getColour ( ) const
inline

References m_category.

◆ getDiffuseIntensity()

float castor3d::Light::getDiffuseIntensity ( ) const
inline

References m_category.

◆ getDirectionalLight()

C3D_API DirectionalLightRPtr castor3d::Light::getDirectionalLight ( ) const

name Getters.

◆ getExpectedGlobalIlluminationType()

GlobalIlluminationType castor3d::Light::getExpectedGlobalIlluminationType ( ) const
inline

◆ getFarPlane()

float castor3d::Light::getFarPlane ( ) const
inline

References m_category.

◆ getGlobalIlluminationType()

GlobalIlluminationType castor3d::Light::getGlobalIlluminationType ( ) const
inline

References m_currentGlobalIllumination.

Referenced by needsRsmShadowMaps().

Here is the caller graph for this function:

◆ getIntensity()

castor::Point2f const & castor3d::Light::getIntensity ( ) const
inline

References m_category.

◆ getLightComponentCount()

uint32_t castor3d::Light::getLightComponentCount ( ) const
inline

References m_category.

◆ getLightType()

LightType castor3d::Light::getLightType ( ) const
inline

References m_category.

◆ getLpvConfig() [1/2]

LpvConfig & castor3d::Light::getLpvConfig ( )
inline

◆ getLpvConfig() [2/2]

LpvConfig const & castor3d::Light::getLpvConfig ( ) const
inline

◆ getPointLight()

C3D_API PointLightRPtr castor3d::Light::getPointLight ( ) const

◆ getShadowComponentCount()

uint32_t castor3d::Light::getShadowComponentCount ( ) const
inline

References m_category.

◆ getShadowConfig() [1/2]

ShadowConfig & castor3d::Light::getShadowConfig ( )
inline

References m_shadows.

◆ getShadowConfig() [2/2]

ShadowConfig const & castor3d::Light::getShadowConfig ( ) const
inline

References m_shadows.

◆ getShadowMap()

ShadowMapRPtr castor3d::Light::getShadowMap ( ) const
inline

References m_shadowMap.

◆ getShadowMapIndex()

int32_t castor3d::Light::getShadowMapIndex ( ) const
inline

References m_shadowMapIndex.

◆ getShadowPcfFilterSize()

castor::RangedValue< uint32_t > castor3d::Light::getShadowPcfFilterSize ( ) const
inline

◆ getShadowPcfOffsets()

castor::Point2f const & castor3d::Light::getShadowPcfOffsets ( ) const
inline

◆ getShadowPcfSampleCount()

castor::RangedValue< uint32_t > castor3d::Light::getShadowPcfSampleCount ( ) const
inline

◆ getShadowRawOffsets()

castor::Point2f const & castor3d::Light::getShadowRawOffsets ( ) const
inline

◆ getShadowType()

ShadowType castor3d::Light::getShadowType ( ) const
inline

◆ getSpecularIntensity()

float castor3d::Light::getSpecularIntensity ( ) const
inline

References m_category.

◆ getSpotLight()

C3D_API SpotLightRPtr castor3d::Light::getSpotLight ( ) const

◆ getVolumetricScatteringFactor()

float castor3d::Light::getVolumetricScatteringFactor ( ) const
inline

◆ getVolumetricSteps()

uint32_t castor3d::Light::getVolumetricSteps ( ) const
inline

◆ getVsmLightBleedingReduction()

float castor3d::Light::getVsmLightBleedingReduction ( ) const
inline

◆ getVsmMinVariance()

float castor3d::Light::getVsmMinVariance ( ) const
inline

◆ isEnabled()

bool castor3d::Light::isEnabled ( ) const
inline

References m_enabled.

◆ isExpectedShadowProducer()

bool castor3d::Light::isExpectedShadowProducer ( ) const
inline

◆ isShadowProducer()

bool castor3d::Light::isShadowProducer ( ) const
inline

References m_currentShadowCaster.

◆ needsRsmShadowMaps()

bool castor3d::Light::needsRsmShadowMaps ( ) const
inline

References castor3d::eNone, castor3d::eVoxelConeTracing, and getGlobalIlluminationType().

Here is the call graph for this function:

◆ setColour() [1/4]

void castor3d::Light::setColour ( castor::Point3f const & value)
inline

References m_category.

◆ setColour() [2/4]

void castor3d::Light::setColour ( castor::RgbColour const & value)
inline

References m_category.

◆ setColour() [3/4]

void castor3d::Light::setColour ( float const * values)
inline

name Mutators.

References m_category.

◆ setColour() [4/4]

void castor3d::Light::setColour ( float r,
float g,
float b )
inline

References m_category.

◆ setDiffuseIntensity()

void castor3d::Light::setDiffuseIntensity ( float value)
inline

References m_category.

◆ setEnabled()

void castor3d::Light::setEnabled ( bool value)
inline

References m_enabled.

Referenced by disable(), and enable().

Here is the caller graph for this function:

◆ setGlobalIlluminationType()

void castor3d::Light::setGlobalIlluminationType ( GlobalIlluminationType value)
inline

References castor3d::ShadowConfig::globalIllumination, m_shadows, and castor3d::MovableObject::markDirty().

Here is the call graph for this function:

◆ setIntensity() [1/3]

void castor3d::Light::setIntensity ( castor::Point2f const & value)
inline

References m_category.

◆ setIntensity() [2/3]

void castor3d::Light::setIntensity ( float const * values)
inline

References m_category.

◆ setIntensity() [3/3]

void castor3d::Light::setIntensity ( float d,
float s )
inline

References m_category.

◆ setPcfFilterSize()

void castor3d::Light::setPcfFilterSize ( uint32_t value)
inline

◆ setPcfMaxSlopeOffset()

void castor3d::Light::setPcfMaxSlopeOffset ( float value)
inline

◆ setPcfMinOffset()

void castor3d::Light::setPcfMinOffset ( float value)
inline

◆ setPcfSampleCount()

void castor3d::Light::setPcfSampleCount ( uint32_t value)
inline

◆ setRawMaxSlopeOffset()

void castor3d::Light::setRawMaxSlopeOffset ( float value)
inline

◆ setRawMinOffset()

void castor3d::Light::setRawMinOffset ( float value)
inline

◆ setShadowConfig()

void castor3d::Light::setShadowConfig ( ShadowConfig config)
inline

References m_shadows, and castor3d::MovableObject::markDirty().

Here is the call graph for this function:

◆ setShadowMap()

void castor3d::Light::setShadowMap ( ShadowMapRPtr value,
int32_t index = -1 )
inline

◆ setShadowMapIndex()

void castor3d::Light::setShadowMapIndex ( int32_t index)
inline

References m_shadowMapIndex, and onGPUChanged.

◆ setShadowType()

void castor3d::Light::setShadowType ( ShadowType value)
inline

◆ setSpecularIntensity()

void castor3d::Light::setSpecularIntensity ( float value)
inline

References m_category.

◆ setVolumetricScatteringFactor()

void castor3d::Light::setVolumetricScatteringFactor ( float value)
inline

◆ setVolumetricSteps()

void castor3d::Light::setVolumetricSteps ( uint32_t value)
inline

◆ setVsmLightBleedingReduction()

void castor3d::Light::setVsmLightBleedingReduction ( float value)
inline

◆ setVsmMinVariance()

void castor3d::Light::setVsmMinVariance ( float value)
inline

◆ update()

C3D_API void castor3d::Light::update ( CpuUpdater & updater)

CPU Update.

Parameters
[in,out]updaterThe update data.

Member Data Documentation

◆ m_bufferIndex

uint32_t castor3d::Light::m_bufferIndex { InvalidIndex }
protected

Referenced by getBufferIndex().

◆ m_bufferOffset

VkDeviceSize castor3d::Light::m_bufferOffset {}
protected

Referenced by getBufferOffset().

◆ m_category

LightCategoryUPtr castor3d::Light::m_category
protected

◆ m_currentGlobalIllumination

std::atomic< GlobalIlluminationType > castor3d::Light::m_currentGlobalIllumination {}
protected

◆ m_currentShadowCaster

std::atomic_bool castor3d::Light::m_currentShadowCaster {}
protected

Referenced by isShadowProducer().

◆ m_dirty

bool castor3d::Light::m_dirty { true }
protected

◆ m_enabled

bool castor3d::Light::m_enabled {}
protected

Referenced by isEnabled(), and setEnabled().

◆ m_shadowMap

ShadowMapRPtr castor3d::Light::m_shadowMap {}
protected

Referenced by getShadowMap(), and setShadowMap().

◆ m_shadowMapIndex

int32_t castor3d::Light::m_shadowMapIndex { -1 }
protected

◆ m_shadows

ShadowConfig castor3d::Light::m_shadows
protected

◆ onGPUChanged

OnLightChanged castor3d::Light::onGPUChanged

Referenced by setShadowMap(), and setShadowMapIndex().


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