OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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:
+ Collaboration 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 =0
 Function to implement – must set the shadow camera properties. More...
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, void *)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 
void * operator new[] (size_t sz)
 

Protected Attributes

Real mMaxDistance
 
Real mMinDistance
 Defines the min & max frustum distance. TODO: put as output from getShadowCamera. More...
 

Detailed Description

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

Remarks
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.
Note
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.

Definition at line 66 of file OgreShadowCameraSetup.h.

Constructor & Destructor Documentation

Ogre::ShadowCameraSetup::ShadowCameraSetup ( )
inline

Definition at line 77 of file OgreShadowCameraSetup.h.

virtual Ogre::ShadowCameraSetup::~ShadowCameraSetup ( )
inlinevirtual

Need virtual destructor in case subclasses use it.

Definition at line 79 of file OgreShadowCameraSetup.h.

Member Function Documentation

Real Ogre::ShadowCameraSetup::getMaxDistance ( ) const
inline

Definition at line 82 of file OgreShadowCameraSetup.h.

Real Ogre::ShadowCameraSetup::getMinDistance ( ) const
inline

Definition at line 81 of file OgreShadowCameraSetup.h.

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

Function to implement – must set the shadow camera properties.

Implemented in Ogre::PSSMShadowCameraSetup, Ogre::DefaultShadowCameraSetup, Ogre::PlaneOptimalShadowCameraSetup, and Ogre::FocusedShadowCameraSetup.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

Definition at line 96 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

Definition at line 102 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 108 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

Definition at line 113 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

Definition at line 119 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

Definition at line 68 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info

Definition at line 86 of file OgreMemoryAllocatedObject.h.

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

Definition at line 91 of file OgreMemoryAllocatedObject.h.

Member Data Documentation

Real Ogre::ShadowCameraSetup::mMaxDistance
mutableprotected

Definition at line 71 of file OgreShadowCameraSetup.h.

Real Ogre::ShadowCameraSetup::mMinDistance
mutableprotected

Defines the min & max frustum distance. TODO: put as output from getShadowCamera.

Definition at line 70 of file OgreShadowCameraSetup.h.


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