OGRE  14.2
Object-Oriented Graphics Rendering Engine
Ogre::ShadowTextureListener Struct Reference

#include <OgreSceneManager.h>

+ Inheritance diagram for Ogre::ShadowTextureListener:

Public Member Functions

 ShadowTextureListener ()
 
virtual ~ShadowTextureListener ()
 
virtual void shadowTextureCasterPreViewProj (Light *light, Camera *camera, size_t iteration)
 This event occurs just before the view & projection matrices are set for rendering into a shadow texture. More...
 
virtual void shadowTextureReceiverPreViewProj (Light *light, Frustum *frustum)
 This event occurs just before the view & projection matrices are set for re-rendering a shadow receiver. More...
 
virtual void shadowTexturesUpdated (size_t numberOfShadowTextures)
 Event raised after all shadow textures have been rendered into for all queues / targets but before any other geometry has been rendered (including main scene geometry and any additional shadow receiver passes). More...
 
virtual bool sortLightsAffectingFrustum (LightList &lightList)
 Hook to allow the listener to override the ordering of lights for the entire frustum. More...
 

Constructor & Destructor Documentation

◆ ShadowTextureListener()

Ogre::ShadowTextureListener::ShadowTextureListener ( )
inline

◆ ~ShadowTextureListener()

virtual Ogre::ShadowTextureListener::~ShadowTextureListener ( )
inlinevirtual

Member Function Documentation

◆ shadowTexturesUpdated()

virtual void Ogre::ShadowTextureListener::shadowTexturesUpdated ( size_t  numberOfShadowTextures)
inlinevirtual

Event raised after all shadow textures have been rendered into for all queues / targets but before any other geometry has been rendered (including main scene geometry and any additional shadow receiver passes).

This callback is useful for those that wish to perform some additional processing on shadow textures before they are used to render shadows. For example you could perform some filtering by rendering the existing shadow textures into another alternative shadow texture with a shader.

Note
This event will only be fired when texture shadows are in use.
Parameters
numberOfShadowTexturesThe number of shadow textures in use

◆ shadowTextureCasterPreViewProj()

virtual void Ogre::ShadowTextureListener::shadowTextureCasterPreViewProj ( Light light,
Camera camera,
size_t  iteration 
)
inlinevirtual

This event occurs just before the view & projection matrices are set for rendering into a shadow texture.

You can use this event hook to perform some custom processing, such as altering the camera being used for rendering the light's view, including setting custom view & projection matrices if you want to perform an advanced shadow technique.

Note
This event will only be fired when texture shadows are in use.
Parameters
lightPointer to the light for which shadows are being rendered
cameraPointer to the camera being used to render
iterationFor lights that use multiple shadow textures, the iteration number

◆ shadowTextureReceiverPreViewProj()

virtual void Ogre::ShadowTextureListener::shadowTextureReceiverPreViewProj ( Light light,
Frustum frustum 
)
inlinevirtual

This event occurs just before the view & projection matrices are set for re-rendering a shadow receiver.

You can use this event hook to perform some custom processing, such as altering the projection frustum being used for rendering the shadow onto the receiver to perform an advanced shadow technique.

Note
This event will only be fired when texture shadows are in use.
Parameters
lightPointer to the light for which shadows are being rendered
frustumPointer to the projection frustum being used to project the shadow texture

◆ sortLightsAffectingFrustum()

virtual bool Ogre::ShadowTextureListener::sortLightsAffectingFrustum ( LightList lightList)
inlinevirtual

Hook to allow the listener to override the ordering of lights for the entire frustum.

Whilst ordinarily lights are sorted per rendered object (MovableObject::queryLights), texture shadows adds another issue in that, given there is a finite number of shadow textures, we must choose which lights to render texture shadows from based on the entire frustum. These lights should always be listed first in every objects own list, followed by any other lights which will not cast texture shadows (either because they have shadow casting off, or there aren't enough shadow textures to service them).

This hook allows you to override the detailed ordering of the lights per frustum. The default ordering is shadow casters first (which you must also respect if you override this method), and ordered by distance from the camera within those 2 groups. Obviously the closest lights with shadow casting enabled will be listed first. Only lights within the range of the frustum will be in the list.

Parameters
lightListThe list of lights within range of the frustum which you may sort.
Returns
true if you sorted the list, false otherwise.

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