OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::PSSMShadowCameraSetup Class Reference

Parallel Split Shadow Map (PSSM) shadow camera setup. More...

#include <OgreShadowCameraSetupPSSM.h>

+ Inheritance diagram for Ogre::PSSMShadowCameraSetup:
+ Collaboration diagram for Ogre::PSSMShadowCameraSetup:

Public Types

typedef vector< Real >::type SplitPointList
 

Public Member Functions

 PSSMShadowCameraSetup ()
 Constructor, defaults to 3 splits. More...
 
virtual ~PSSMShadowCameraSetup ()
 
void calculateSplitPoints (uint splitCount, Real nearDist, Real farDist, Real lambda=0.95)
 Calculate a new splitting scheme. More...
 
Real getMaxDistance () const
 
Real getMinDistance () const
 
virtual void getShadowCamera (const Ogre::SceneManager *sm, const Ogre::Camera *cam, const Ogre::Light *light, Ogre::Camera *texCam, size_t iteration) const
 Returns a LiSPSM shadow camera with PSSM splits base on iteration. More...
 
uint getSplitCount () const
 Get the number of splits. More...
 
Real getSplitPadding () const
 Get the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'. More...
 
const SplitPointListgetSplitPoints () const
 Returns the calculated split points. 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)
 
void setOptimalAdjustFactor (size_t splitIndex, Real factor)
 Set the LiSPSM optimal adjust factor for a given split (call after configuring splits). More...
 
void setSplitPadding (Real pad)
 Set the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'. More...
 
void setSplitPoints (const SplitPointList &newSplitPoints)
 Manually configure a new splitting scheme. More...
 

Protected Attributes

size_t mCurrentIteration
 
Real mMaxDistance
 
Real mMinDistance
 Defines the min & max frustum distance. TODO: put as output from getShadowCamera. More...
 
uint mSplitCount
 
Real mSplitPadding
 
SplitPointList mSplitPoints
 

Detailed Description

Parallel Split Shadow Map (PSSM) shadow camera setup.

Remarks
A PSSM shadow system uses multiple shadow maps per light and maps each texture into a region of space, progressing away from the camera. As such it is most appropriate for directional light setups. This particular version also uses LiSPSM projection for each split to maximise the quality.
Note
Because PSSM uses multiple shadow maps per light, you will need to increase the number of shadow textures available (via SceneManager) to match the number of shadow maps required (default is 3 per light).

Definition at line 56 of file OgreShadowCameraSetupPSSM.h.

Member Typedef Documentation

Constructor & Destructor Documentation

Ogre::PSSMShadowCameraSetup::PSSMShadowCameraSetup ( )

Constructor, defaults to 3 splits.

virtual Ogre::PSSMShadowCameraSetup::~PSSMShadowCameraSetup ( )
virtual

Member Function Documentation

void Ogre::PSSMShadowCameraSetup::calculateSplitPoints ( uint  splitCount,
Real  nearDist,
Real  farDist,
Real  lambda = 0.95 
)

Calculate a new splitting scheme.

Parameters
splitCountThe number of splits to use
nearDistThe near plane to use for the first split
farDistThe far plane to use for the last split
lambdaFactor to use to reduce the split size
Real Ogre::ShadowCameraSetup::getMaxDistance ( ) const
inlineinherited

Definition at line 82 of file OgreShadowCameraSetup.h.

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

Definition at line 81 of file OgreShadowCameraSetup.h.

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

Returns a LiSPSM shadow camera with PSSM splits base on iteration.

Reimplemented from Ogre::FocusedShadowCameraSetup.

uint Ogre::PSSMShadowCameraSetup::getSplitCount ( ) const
inline

Get the number of splits.

Definition at line 104 of file OgreShadowCameraSetupPSSM.h.

Real Ogre::PSSMShadowCameraSetup::getSplitPadding ( ) const
inline

Get the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.

Definition at line 102 of file OgreShadowCameraSetupPSSM.h.

const SplitPointList& Ogre::PSSMShadowCameraSetup::getSplitPoints ( ) const
inline

Returns the calculated split points.

Definition at line 111 of file OgreShadowCameraSetupPSSM.h.

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.

void Ogre::PSSMShadowCameraSetup::setOptimalAdjustFactor ( size_t  splitIndex,
Real  factor 
)

Set the LiSPSM optimal adjust factor for a given split (call after configuring splits).

void Ogre::PSSMShadowCameraSetup::setSplitPadding ( Real  pad)
inline

Set the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.

Definition at line 97 of file OgreShadowCameraSetupPSSM.h.

void Ogre::PSSMShadowCameraSetup::setSplitPoints ( const SplitPointList newSplitPoints)

Manually configure a new splitting scheme.

Parameters
newSplitPointsA list which is splitCount + 1 entries long, containing the split points. The first value is the near point, the last value is the far point, and each value in between is both a far point of the previous split, and a near point for the next one.

Member Data Documentation

size_t Ogre::PSSMShadowCameraSetup::mCurrentIteration
mutableprotected

Definition at line 66 of file OgreShadowCameraSetupPSSM.h.

Real Ogre::ShadowCameraSetup::mMaxDistance
mutableprotectedinherited

Definition at line 71 of file OgreShadowCameraSetup.h.

Real Ogre::ShadowCameraSetup::mMinDistance
mutableprotectedinherited

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

Definition at line 70 of file OgreShadowCameraSetup.h.

uint Ogre::PSSMShadowCameraSetup::mSplitCount
protected

Definition at line 62 of file OgreShadowCameraSetupPSSM.h.

Real Ogre::PSSMShadowCameraSetup::mSplitPadding
protected

Definition at line 64 of file OgreShadowCameraSetupPSSM.h.

SplitPointList Ogre::PSSMShadowCameraSetup::mSplitPoints
protected

Definition at line 63 of file OgreShadowCameraSetupPSSM.h.


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