Rebel Fork Framework
Urho3D::LightProcessor Class Reference

Manages light parameters, lit geometries, shadow splits and shadow casters. More...

#include <Urho3D/RenderPipeline/LightProcessor.h>

Inheritance diagram for Urho3D::LightProcessor:
Urho3D::NonCopyable

Public Member Functions

 LightProcessor (Light *light)
 
void BeginUpdate (DrawableProcessor *drawableProcessor, LightProcessorCallback *callback)
 Begin update from main thread.
 
void Update (DrawableProcessor *drawableProcessor, const LightProcessorCallback *callback)
 Update light in worker thread.
 
void EndUpdate (DrawableProcessor *drawableProcessor, LightProcessorCallback *callback, unsigned pcfKernelSize)
 End update from main thread.
 
unsigned GetForwardLitHash () const
 
unsigned GetShadowHash (unsigned splitIndex) const
 
unsigned GetLightVolumeHash () const
 
LightGetLight () const
 
const ea::vector< Drawable * > & GetLitGeometries () const
 
bool HasForwardLitGeometries () const
 
bool HasLitGeometries () const
 
bool DoesOverlapCamera () const
 
bool HasShadow () const
 
IntVector2 GetShadowMapSize () const
 
unsigned GetNumSplits () const
 
const ShadowSplitProcessorGetSplit (unsigned splitIndex) const
 
ShadowSplitProcessorGetMutableSplit (unsigned splitIndex)
 
ea::span< const ShadowSplitProcessorGetSplits () const
 
ea::span< ShadowSplitProcessorGetMutableSplits ()
 
ShadowMapRegion GetShadowMap () const
 
const CookedLightParamsGetParams () const
 

Static Public Attributes

static const unsigned NumSplitFramesToLive = 600
 Number of frames for shadow splits expiration.
 

Private Member Functions

void InitializeShadowSplits (DrawableProcessor *drawableProcessor)
 
void UpdateHashes ()
 
void CookShaderParameters (Camera *cullCamera, const DrawableProcessorSettings &settings)
 
IntVector2 GetNumSplitsInGrid () const
 

Private Attributes

Lightlight_ {}
 
ea::vector< ShadowSplitProcessorsplits_
 
unsigned splitRemainingTimeToLive_ {}
 
RenderBackend renderBackend_ {}
 
bool isShadowRequested_ {}
 
unsigned numSplitsRequested_ {}
 
bool cameraIsInsideLightVolume_ {}
 
unsigned numActiveSplits_ {}
 
int shadowMapSplitSize_ {}
 
IntVector2 shadowMapSize_ {}
 
bool hasLitGeometries_ {}
 
bool hasForwardLitGeometries_ {}
 
ea::vector< Drawable * > litGeometries_
 
ea::vector< Drawable * > shadowCasterCandidates_
 
ShadowMapRegion shadowMap_
 Accumulative shadow map region containing all the splits.
 
CookedLightParams cookedParams_
 
unsigned forwardLitBatchHash_ {}
 
unsigned lightVolumeBatchHash_ {}
 
ea::array< unsigned, MAX_LIGHT_SPLITS > shadowBatchStateHashes_ {}
 

Additional Inherited Members

- Protected Member Functions inherited from Urho3D::NonCopyable
 NonCopyable (const NonCopyable &other)=delete
 
 NonCopyable (NonCopyable &&other)=delete
 
NonCopyableoperator= (const NonCopyable &other)=delete
 
NonCopyableoperator= (NonCopyable &&other)=delete
 

Detailed Description

Manages light parameters, lit geometries, shadow splits and shadow casters.

Member Function Documentation

◆ GetForwardLitHash()

unsigned Urho3D::LightProcessor::GetForwardLitHash ( ) const
inline

Return pipeline state hashes

◆ GetLight()

Light* Urho3D::LightProcessor::GetLight ( ) const
inline

Return values are always valid

◆ GetLitGeometries()

const ea::vector<Drawable*>& Urho3D::LightProcessor::GetLitGeometries ( ) const
inline

Return values are valid after threaded update

◆ GetSplit()

const ShadowSplitProcessor* Urho3D::LightProcessor::GetSplit ( unsigned  splitIndex) const
inline

Return values are valid after update is finished

◆ InitializeShadowSplits()

void Urho3D::LightProcessor::InitializeShadowSplits ( DrawableProcessor drawableProcessor)
private

Setup splits

Member Data Documentation

◆ cameraIsInsideLightVolume_

bool Urho3D::LightProcessor::cameraIsInsideLightVolume_ {}
private

Processing results

◆ forwardLitBatchHash_

unsigned Urho3D::LightProcessor::forwardLitBatchHash_ {}
private

Pipeline state hashes

◆ isShadowRequested_

bool Urho3D::LightProcessor::isShadowRequested_ {}
private

Parameters extracted from light settings

◆ litGeometries_

ea::vector<Drawable*> Urho3D::LightProcessor::litGeometries_
private

Point and spot lights: only forward lit geometries. Directional lights: all lit geometries, for shadow focusing.

◆ shadowCasterCandidates_

ea::vector<Drawable*> Urho3D::LightProcessor::shadowCasterCandidates_
private

Point and spot lights: all possible shadow casters. Directional lights: temporary buffer for split queries.


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