LightShadowMap

Engine/source/lighting/shadowMap/lightShadowMap.h

This represents everything we need to render the shadowmap for one light.

More...

Public Static Attributes

bool

Whether to render shadow frustums for lights that have debug rendering enabled.

Used to scale the shadow texture size for performance tweaking.

Protected Static Attributes

All the shadow maps in the system.

All the shadow maps that have been recently rendered to.

Protected Attributes

Helper for rendering shadow map for debugging.

bool

If true the shadow is view dependent and cannot be skipped if visible and within active range.

The time this shadow was last culled and prioritized.

Public Functions

Returns the best texture size based on the user texture size, the last light screen size, and global shadow tweak parameters.

Returns the correct shadow material this type of light or NULL if no shadow material is possible.

bool
render(RenderPassManager * renderPass, const SceneRenderState * diffuseState)
bool

Public Static Functions

Releases any shadow maps that have not been culled in a while and returns the count of the remaing shadow maps in use.

Protected Functions

_debugRender(SceneRenderState * shadowRenderState)

If there is a LightDebugInfo attached to the light that owns this map, then update its information from the given render state.

The callback used to get texture events.

_render(RenderPassManager * renderPass, const SceneRenderState * diffuseState)
calcLightMatrices(MatrixF & outLightMatrix, const Frustum & viewFrustum)

Detailed Description

This represents everything we need to render the shadowmap for one light.

Public Static Attributes

const GFXFormat ShadowMapFormat 
bool smDebugRenderFrustums 

Whether to render shadow frustums for lights that have debug rendering enabled.

F32 smShadowTexScalar 

Used to scale the shadow texture size for performance tweaking.

Protected Static Attributes

Vector< LightShadowMap * > smShadowMaps 

All the shadow maps in the system.

Vector< LightShadowMap * > smUsedShadowMaps 

All the shadow maps that have been recently rendered to.

Protected Attributes

GFXShaderConstHandle * mBlurBoundaries 
NamedTexTarget mDebugTarget 

Helper for rendering shadow map for debugging.

bool mIsViewDependent 

If true the shadow is view dependent and cannot be skipped if visible and within active range.

U32 mLastCull 

The time this shadow was last culled and prioritized.

F32 mLastPriority 
F32 mLastScreenSize 
GFXShader * mLastShader 
LightInfo * mLight 
GFXTexHandle mShadowMapDepth 
GFXTexHandle mShadowMapTex 
GFXTextureTargetRef mTarget 
U32 mTexSize 
MatrixF mWorldToLightProj 

Public Functions

LightShadowMap(LightInfo * light)

~LightShadowMap()

getBestTexSize(U32 scale)

Returns the best texture size based on the user texture size, the last light screen size, and global shadow tweak parameters.

getLastPriority()

getLastScreenSize()

getLightInfo()

getShadowMaterial(BaseMatInstance * inMat)

Returns the correct shadow material this type of light or NULL if no shadow material is possible.

getShadowType()

Reimplemented by: CubeLightShadowMap, ParaboloidLightShadowMap, PSSMLightShadowMap, SingleLightShadowMap

getTexSize()

getTexture()

getWorldToLightProj()

hasShadowTex()

Reimplemented by: CubeLightShadowMap

isViewDependent()

releaseTextures()

Reimplemented by: CubeLightShadowMap

render(RenderPassManager * renderPass, const SceneRenderState * diffuseState)

setDebugTarget(const String & name)

setShaderParameters(GFXShaderConstBuffer * params, LightingShaderConstants * lsc)

Reimplemented by: CubeLightShadowMap, ParaboloidLightShadowMap, PSSMLightShadowMap, SingleLightShadowMap

setTextureStage(U32 currTexFlag, LightingShaderConstants * lsc)

Reimplemented by: CubeLightShadowMap

updatePriority(const SceneRenderState * state, U32 currTimeMs)

Public Static Functions

_getDepthTarget(U32 width, U32 height)

cmpPriority(LightShadowMap *const * lsm1, LightShadowMap *const * lsm2)

releaseAllTextures()

releaseUnusedTextures()

Releases any shadow maps that have not been culled in a while and returns the count of the remaing shadow maps in use.

Protected Functions

_debugRender(SceneRenderState * shadowRenderState)

If there is a LightDebugInfo attached to the light that owns this map, then update its information from the given render state.

note:

This method only does something in debug builds.

_onTextureEvent(GFXTexCallbackCode code)

The callback used to get texture events.

_render(RenderPassManager * renderPass, const SceneRenderState * diffuseState)

Reimplemented by: CubeLightShadowMap, DualParaboloidLightShadowMap, ParaboloidLightShadowMap, PSSMLightShadowMap, SingleLightShadowMap

calcLightMatrices(MatrixF & outLightMatrix, const Frustum & viewFrustum)