OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::ShadowCameraSetup Class Referenceabstract

This class allows you to plug in new ways to define the camera setup when rendering and projecting shadow textures. More...

#include <OgreShadowCameraSetup.h>

+ Inheritance diagram for Ogre::ShadowCameraSetup:

Public Member Functions

 ShadowCameraSetup ()
virtual ~ShadowCameraSetup ()
 Need virtual destructor in case subclasses use it. More...
Real getMaxDistance () const
Real getMinDistance () const
virtual void getShadowCamera (const SceneManager *sm, const Camera *cam, const Light *light, Camera *texCam, size_t iteration, const Vector2 &viewportRealSize) const =0
 Function to implement – must set the shadow camera properties. More...

Static Public Member Functions

static void setUseEsm (bool useEsm)

Detailed Description

This class allows you to plug in new ways to define the camera setup when rendering and projecting shadow textures.

The default projection used when rendering shadow textures is a uniform frustum. This is pretty straight forward but doesn't make the best use of the space in the shadow map since texels closer to the camera will be larger, resulting in 'jaggies'. There are several ways to distribute the texels in the shadow texture differently, and this class allows you to override that.
Ogre is provided with several alternative shadow camera setups, including LiSPSM (LiSPSMShadowCameraSetup) and Plane Optimal (PlaneOptimalShadowCameraSetup). Others can of course be written to incorporate other algorithms. All you have to do is instantiate one of these classes and enable it using SceneManager::setShadowCameraSetup (global) or Light::setCustomShadowCameraSetup (per light). In both cases the instance is wrapped in a SharedPtr which means it will be deleted automatically when no more references to it exist.
Shadow map matrices, being projective matrices, have 15 degrees of freedom. 3 of these degrees of freedom are fixed by the light's position. 4 are used to affinely affect z values. 6 affinely affect u,v sampling. 2 are projective degrees of freedom. This class is meant to allow custom methods for handling optimization.

Constructor & Destructor Documentation

◆ ShadowCameraSetup()

Ogre::ShadowCameraSetup::ShadowCameraSetup ( )

◆ ~ShadowCameraSetup()

virtual Ogre::ShadowCameraSetup::~ShadowCameraSetup ( )

Need virtual destructor in case subclasses use it.

Member Function Documentation

◆ getMaxDistance()

Real Ogre::ShadowCameraSetup::getMaxDistance ( ) const

◆ getMinDistance()

Real Ogre::ShadowCameraSetup::getMinDistance ( ) const

◆ getShadowCamera()

virtual void Ogre::ShadowCameraSetup::getShadowCamera ( const SceneManager sm,
const Camera cam,
const Light light,
Camera texCam,
size_t  iteration,
const Vector2 viewportRealSize 
) const
pure virtual

◆ setUseEsm()

static void Ogre::ShadowCameraSetup::setUseEsm ( bool  useEsm)

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