Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Public Attributes | Protected Member Functions | 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. More...
 
C3D_API void update (CpuUpdater &updater)
 CPU Update. More...
 
C3D_API void fillBuffer (uint32_t index, LightBuffer::LightData &data)
 Records the light data into given buffer. More...
 
C3D_API void attachTo (SceneNode &node) override
 Attaches this light to a SceneNode. More...
 
C3D_API DirectionalLightSPtr getDirectionalLight () const
 
C3D_API PointLightSPtr getPointLight () const
 
C3D_API SpotLightSPtr getSpotLight () const
 
bool hasChanged () const
 
LightType getLightType () 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
 
LightCategorySPtr getCategory () const
 
bool isShadowProducer () const
 
bool isExpectedShadowProducer () const
 
ShadowType getShadowType () const
 
ShadowMapRPtr getShadowMap () const
 
uint32_t getShadowMapIndex () const
 
uint32_t getBufferIndex () const
 
bool needsRsmShadowMaps () const
 
GlobalIlluminationType getGlobalIlluminationType () const
 
GlobalIlluminationType getExpectedGlobalIlluminationType () const
 
RsmConfig const & getRsmConfig () const
 
RsmConfiggetRsmConfig ()
 
LpvConfig const & getLpvConfig () const
 
LpvConfiggetLpvConfig ()
 
uint32_t getVolumetricSteps () const
 
float getVolumetricScatteringFactor () const
 
castor::Point2f const & getShadowRawOffsets () const
 
castor::Point2f const & getShadowPcfOffsets () const
 
castor::Point2f const & getShadowVariance () const
 
ShadowConfig const & getShadowConfig () const
 
void setColour (float *values)
 
void setColour (float r, float g, float b)
 
void setColour (castor::Point3f const &value)
 
void setColour (castor::RgbColour const &value)
 
void setIntensity (float *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 setShadowProducer (bool value)
 
void setShadowMap (ShadowMapRPtr value, uint32_t index=0u)
 
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 setVsmMaxVariance (float value)
 
void setVsmVarianceBias (float value)
 
void setBufferIndex (uint32_t value)
 
- Public Member Functions inherited from castor3d::MovableObject
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type, SceneNode &node)
 Constructor. More...
 
C3D_API MovableObject (castor::String const &name, Scene &scene, MovableType type)
 Constructor. More...
 
virtual C3D_API ~MovableObject ()
 Destructor. More...
 
C3D_API void detach ()
 Detaches the movable object from it's parent. More...
 
virtual C3D_API void attachTo (SceneNode &node)
 Attaches the movable object to a node. More...
 
C3D_API EngineRPtr getEngine () const
 
SceneNodegetParent () const
 
MovableType getType () const
 

Public Attributes

OnLightChanged onChanged
 
OnLightChanged onGPUChanged
 

Protected Member Functions

void onNodeChanged (SceneNode const &node)
 

Protected Attributes

bool m_enabled { false }
 
bool m_shadowCaster { false }
 
std::atomic_bool m_currentShadowCaster { false }
 
bool m_dirty { true }
 
ShadowConfig m_shadows
 
LightCategorySPtr m_category
 
ShadowMapRPtr m_shadowMap { nullptr }
 
uint32_t m_shadowMapIndex { 0u }
 
std::atomic< GlobalIlluminationTypem_currentGlobalIllumination { GlobalIlluminationType::eNone }
 
uint32_t m_bufferIndex { 0u }
 
- Protected Attributes inherited from castor3d::MovableObject
MovableType m_type
 
castor::String m_strNodeName
 
SceneNodem_sceneNode
 
OnSceneNodeChangedConnection m_notifyIndex
 

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

◆ attachTo()

C3D_API void castor3d::Light::attachTo ( SceneNode node)
overridevirtual

Attaches this light to a SceneNode.

Parameters
[in]nodeThe new light's parent node.

Reimplemented from castor3d::MovableObject.

◆ 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:

◆ fillBuffer()

C3D_API void castor3d::Light::fillBuffer ( uint32_t  index,
LightBuffer::LightData data 
)

Records the light data into given buffer.

Parameters
[in]indexThe light index in the buffer.
[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.

◆ getCategory()

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

◆ 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 PointLightSPtr castor3d::Light::getPointLight ( ) const

◆ getRsmConfig() [1/2]

RsmConfig & castor3d::Light::getRsmConfig ( )
inline

◆ getRsmConfig() [2/2]

RsmConfig const & castor3d::Light::getRsmConfig ( ) const
inline

◆ getShadowConfig()

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

References m_shadows.

◆ getShadowMap()

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

References m_shadowMap.

◆ getShadowMapIndex()

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

References m_shadowMapIndex.

◆ getShadowPcfOffsets()

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

◆ getShadowRawOffsets()

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

◆ getShadowType()

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

◆ getShadowVariance()

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

◆ getSpecularIntensity()

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

References m_category.

◆ getSpotLight()

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

◆ getVolumetricScatteringFactor()

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

◆ getVolumetricSteps()

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

◆ hasChanged()

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

References m_dirty.

◆ isEnabled()

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

References m_enabled.

◆ isExpectedShadowProducer()

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

References m_shadowCaster.

◆ isShadowProducer()

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

References m_currentShadowCaster.

◆ needsRsmShadowMaps()

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

References castor3d::eNone, and getGlobalIlluminationType().

Here is the call graph for this function:

◆ onNodeChanged()

void castor3d::Light::onNodeChanged ( SceneNode const &  node)
protected

◆ setBufferIndex()

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

References m_bufferIndex.

◆ 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 *  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

◆ setIntensity() [1/3]

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

References m_category.

◆ setIntensity() [2/3]

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

References m_category.

◆ setIntensity() [3/3]

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

References m_category.

◆ setPcfMaxSlopeOffset()

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

◆ setPcfMinOffset()

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

◆ setRawMaxSlopeOffset()

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

◆ setRawMinOffset()

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

◆ setShadowMap()

void castor3d::Light::setShadowMap ( ShadowMapRPtr  value,
uint32_t  index = 0u 
)
inline

◆ setShadowProducer()

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

References m_shadowCaster, and onChanged.

◆ 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

◆ setVsmMaxVariance()

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

◆ setVsmVarianceBias()

void castor3d::Light::setVsmVarianceBias ( 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 { 0u }
protected

Referenced by getBufferIndex(), and setBufferIndex().

◆ m_category

LightCategorySPtr castor3d::Light::m_category
protected

◆ m_currentGlobalIllumination

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

◆ m_currentShadowCaster

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

Referenced by isShadowProducer().

◆ m_dirty

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

Referenced by hasChanged().

◆ m_enabled

bool castor3d::Light::m_enabled { false }
protected

Referenced by isEnabled(), and setEnabled().

◆ m_shadowCaster

bool castor3d::Light::m_shadowCaster { false }
protected

◆ m_shadowMap

ShadowMapRPtr castor3d::Light::m_shadowMap { nullptr }
protected

Referenced by getShadowMap(), and setShadowMap().

◆ m_shadowMapIndex

uint32_t castor3d::Light::m_shadowMapIndex { 0u }
protected

Referenced by getShadowMapIndex(), and setShadowMap().

◆ m_shadows

ShadowConfig castor3d::Light::m_shadows
protected

◆ onChanged

OnLightChanged castor3d::Light::onChanged

◆ onGPUChanged

OnLightChanged castor3d::Light::onGPUChanged

Referenced by setShadowMap().


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