Implements the Light Space Perspective Shadow Mapping Algorithm. More...
#include <OgreShadowCameraSetupLiSPSM.h>

Public Member Functions | |
| LiSPSMShadowCameraSetup (void) | |
| Default constructor. | |
| virtual | ~LiSPSMShadowCameraSetup (void) |
| Default destructor. | |
| virtual Degree | getCameraLightDirectionThreshold () const |
| Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'flattened', since coincident light and camera projections cause problems with the perspective skew. | |
| virtual Real | getOptimalAdjustFactor () const |
| Get the parameter n used to produce optimal shadows. | |
| virtual void | getShadowCamera (const SceneManager *sm, const Camera *cam, const Viewport *vp, const Light *light, Camera *texCam, size_t iteration) const |
| Returns a LiSPSM shadow camera. | |
| bool | getUseAggressiveFocusRegion () const |
| virtual bool | getUseSimpleOptimalAdjust () const |
| Gets whether or not to use a slightly simpler version of the camera near point derivation (default is true) | |
| 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 | |
| void * | operator new (size_t sz) |
| void * | operator new (size_t sz, void *ptr) |
| placement operator new | |
| void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
| array operator new, with debug line info | |
| void * | operator new[] (size_t sz) |
| virtual void | setCameraLightDirectionThreshold (Degree angle) |
| Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'flattened', since coincident light and camera projections cause problems with the perspective skew. | |
| virtual void | setOptimalAdjustFactor (Real n) |
| Adjusts the parameter n to produce optimal shadows. | |
| void | setUseAggressiveFocusRegion (bool aggressive) |
| Sets whether or not to use the more aggressive approach to deciding on the focus region or not. | |
| virtual void | setUseSimpleOptimalAdjust (bool s) |
| Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true) | |
Protected Member Functions | |
| Matrix4 | buildFrustumProjection (Real left, Real right, Real bottom, Real top, Real near, Real far) const |
| Builds a frustum matrix. | |
| Matrix4 | buildViewMatrix (const Vector3 &pos, const Vector3 &dir, const Vector3 &up) const |
| Builds a view matrix. | |
| void | calculateB (const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, const AxisAlignedBox &receiverBB, PointListBody *out_bodyB) const |
| Calculates the intersection bodyB. | |
| Matrix4 | calculateLiSPSM (const Matrix4 &lightSpace, const PointListBody &bodyB, const PointListBody &bodyLVS, const SceneManager &sm, const Camera &cam, const Light &light) const |
| Calculates the LiSPSM projection matrix P. | |
| void | calculateLVS (const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, PointListBody *out_LVS) const |
| Calculates the bodyLVS. | |
| Real | calculateNOpt (const Matrix4 &lightSpace, const AxisAlignedBox &bodyBABB_ls, const PointListBody &bodyLVS, const Camera &cam) const |
| Calculates the distance between camera position and near clipping plane. | |
| Real | calculateNOptSimple (const PointListBody &bodyLVS, const Camera &cam) const |
| Calculates a simpler version than the one above. | |
| void | calculateShadowMappingMatrix (const SceneManager &sm, const Camera &cam, const Light &light, Matrix4 *out_view, Matrix4 *out_proj, Camera *out_cam) const |
| Calculates the standard shadow mapping matrix. | |
| Vector3 | calculateZ0_ls (const Matrix4 &lightSpace, const Vector3 &e, Real bodyB_zMax_ls, const Camera &cam) const |
| Calculates the visible point on the near plane for the n_opt calculation. | |
| Vector3 | getLSProjViewDir (const Matrix4 &lightSpace, const Camera &cam, const PointListBody &bodyLVS) const |
| Returns the projection view direction. | |
| Vector3 | getNearCameraPoint_ws (const Matrix4 &viewMatrix, const PointListBody &bodyLVS) const |
| Returns a valid near-point seen by the camera. | |
| Matrix4 | transformToUnitCube (const Matrix4 &m, const PointListBody &body) const |
| Transforms a given body to the unit cube (-1,-1,-1) / (+1,+1,+1) with a specific shadow matrix enabled. | |
Protected Attributes | |
| ConvexBody | mBodyB |
| Real | mCosCamLightDirThreshold |
| Threshold (cos angle) within which to start increasing the opt adjust as camera direction approaches light direction. | |
| Camera * | mLightFrustumCamera |
| Temporary preallocated camera to set up a light frustum for clipping in FocusedShadowCameraSetup::calculateB. | |
| bool | mLightFrustumCameraCalculated |
| Real | mOptAdjustFactor |
| Warp factor adjustment. | |
| Real | mOptAdjustFactorTweak |
| Extra calculated warp factor. | |
| PointListBody | mPointListBodyB |
| PointListBody | mPointListBodyLVS |
| Frustum * | mTempFrustum |
| Temporary preallocated frustum to set up a projection matrix in calculateShadowMappingMatrix(). | |
| bool | mUseAggressiveRegion |
| Use tighter focus region? | |
| bool | mUseSimpleNOpt |
| Use simple nopt derivation? | |
Static Protected Attributes | |
| static const Matrix4 | msLightSpaceToNormal |
| static const Matrix4 | msNormalToLightSpace |
| Transform to or from light space as defined by Wimmer et al. | |
Implements the Light Space Perspective Shadow Mapping Algorithm.
Definition at line 98 of file OgreShadowCameraSetupLiSPSM.h.
Default constructor.
| virtual Ogre::LiSPSMShadowCameraSetup::~LiSPSMShadowCameraSetup | ( | void | ) | [virtual] |
Default destructor.
| Matrix4 Ogre::LiSPSMShadowCameraSetup::buildFrustumProjection | ( | Real | left, |
| Real | right, | ||
| Real | bottom, | ||
| Real | top, | ||
| Real | near, | ||
| Real | far | ||
| ) | const [protected] |
Builds a frustum matrix.
| Matrix4 Ogre::FocusedShadowCameraSetup::buildViewMatrix | ( | const Vector3 & | pos, |
| const Vector3 & | dir, | ||
| const Vector3 & | up | ||
| ) | const [protected, inherited] |
Builds a view matrix.
| void Ogre::FocusedShadowCameraSetup::calculateB | ( | const SceneManager & | sm, |
| const Camera & | cam, | ||
| const Light & | light, | ||
| const AxisAlignedBox & | sceneBB, | ||
| const AxisAlignedBox & | receiverBB, | ||
| PointListBody * | out_bodyB | ||
| ) | const [protected, inherited] |
Calculates the intersection bodyB.
| sm | Scene manager. |
| cam | Currently active camera. |
| light | Currently active light. |
| sceneBB | Scene bounding box for clipping operations. |
| receiverBB | Bounding information for just the receivers. |
| out_bodyB | Final intersection bodyB point list. |
| Matrix4 Ogre::LiSPSMShadowCameraSetup::calculateLiSPSM | ( | const Matrix4 & | lightSpace, |
| const PointListBody & | bodyB, | ||
| const PointListBody & | bodyLVS, | ||
| const SceneManager & | sm, | ||
| const Camera & | cam, | ||
| const Light & | light | ||
| ) | const [protected] |
Calculates the LiSPSM projection matrix P.
| lightSpace | Matrix of the light space transformation |
| bodyB | Intersection body B |
| bodyLVS | Intersection body LVS (relevant space in front of the camera) |
| sm | Scene manager |
| cam | Currently active camera |
| light | Currently active light |
| void Ogre::FocusedShadowCameraSetup::calculateLVS | ( | const SceneManager & | sm, |
| const Camera & | cam, | ||
| const Light & | light, | ||
| const AxisAlignedBox & | sceneBB, | ||
| PointListBody * | out_LVS | ||
| ) | const [protected, inherited] |
Calculates the bodyLVS.
| cam | Current viewer camera. |
| light | Current light. |
| sceneBB | Holds all potential occluders / receivers as one single bounding box of the currently active scene node. |
| out_LVS | Intersection body LVS (world coordinates). |
| Real Ogre::LiSPSMShadowCameraSetup::calculateNOpt | ( | const Matrix4 & | lightSpace, |
| const AxisAlignedBox & | bodyBABB_ls, | ||
| const PointListBody & | bodyLVS, | ||
| const Camera & | cam | ||
| ) | const [protected] |
Calculates the distance between camera position and near clipping plane.
Formula: d n_opt = --------------- sqrt(z1/z0) - 1
Parameters: d: distance between the near and the far clipping plane z0: located on the near clipping plane of the intersection body b z1: located on the far clipping plane with the same x/y values as z0
| lightSpace | Matrix of the light space transformation |
| bodyBABB_ls | Bounding box of the transformed (light space) bodyB |
| bodyLVS | Point list of the bodyLVS which describes the scene space which is in front of the light and the camera |
| cam | Currently active camera |
| Real Ogre::LiSPSMShadowCameraSetup::calculateNOptSimple | ( | const PointListBody & | bodyLVS, |
| const Camera & | cam | ||
| ) | const [protected] |
Calculates a simpler version than the one above.
| void Ogre::FocusedShadowCameraSetup::calculateShadowMappingMatrix | ( | const SceneManager & | sm, |
| const Camera & | cam, | ||
| const Light & | light, | ||
| Matrix4 * | out_view, | ||
| Matrix4 * | out_proj, | ||
| Camera * | out_cam | ||
| ) | const [protected, inherited] |
Calculates the standard shadow mapping matrix.
| sm | Scene manager. |
| cam | Currently active camera. |
| light | Currently active light. |
| out_view | Calculated uniform view shadow mapping matrix (may be NULL). |
| out_proj | Calculated uniform projection shadow mapping matrix (may be NULL). |
| out_cam | Calculated uniform shadow camera (may be NULL). |
| Vector3 Ogre::LiSPSMShadowCameraSetup::calculateZ0_ls | ( | const Matrix4 & | lightSpace, |
| const Vector3 & | e, | ||
| Real | bodyB_zMax_ls, | ||
| const Camera & | cam | ||
| ) | const [protected] |
Calculates the visible point on the near plane for the n_opt calculation.
| lightSpace | Matrix of the light space transformation |
| e | The LiSPSM parameter e is located near or on the near clipping plane of the LiSPSM frustum C |
| bodyB_zMax_ls | Maximum z-value of the light space bodyB bounding box |
| cam | Currently active camera |
| virtual Degree Ogre::LiSPSMShadowCameraSetup::getCameraLightDirectionThreshold | ( | ) | const [virtual] |
Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'flattened', since coincident light and camera projections cause problems with the perspective skew.
| Vector3 Ogre::FocusedShadowCameraSetup::getLSProjViewDir | ( | const Matrix4 & | lightSpace, |
| const Camera & | cam, | ||
| const PointListBody & | bodyLVS | ||
| ) | const [protected, inherited] |
Returns the projection view direction.
| lightSpace | Matrix of the light space transformation. |
| cam | Current viewer camera. |
| bodyLVS | Intersection body LVS (relevant space in front of the camera). |
| Vector3 Ogre::FocusedShadowCameraSetup::getNearCameraPoint_ws | ( | const Matrix4 & | viewMatrix, |
| const PointListBody & | bodyLVS | ||
| ) | const [protected, inherited] |
Returns a valid near-point seen by the camera.
| viewMatrix | View matrix of the current camera. |
| bodyLVS | Intersection body LVS (relevant space in front of the camera). |
| virtual Real Ogre::LiSPSMShadowCameraSetup::getOptimalAdjustFactor | ( | ) | const [virtual] |
Get the parameter n used to produce optimal shadows.
Reimplemented in Ogre::PSSMShadowCameraSetup.
Definition at line 220 of file OgreShadowCameraSetupLiSPSM.h.
| virtual void Ogre::LiSPSMShadowCameraSetup::getShadowCamera | ( | const SceneManager * | sm, |
| const Camera * | cam, | ||
| const Viewport * | vp, | ||
| const Light * | light, | ||
| Camera * | texCam, | ||
| size_t | iteration | ||
| ) | const [virtual] |
Returns a LiSPSM shadow camera.
Reimplemented from Ogre::FocusedShadowCameraSetup.
Reimplemented in Ogre::PSSMShadowCameraSetup.
| bool Ogre::FocusedShadowCameraSetup::getUseAggressiveFocusRegion | ( | ) | const [inherited] |
Definition at line 305 of file OgreShadowCameraSetupFocused.h.
| virtual bool Ogre::LiSPSMShadowCameraSetup::getUseSimpleOptimalAdjust | ( | ) | const [virtual] |
Gets whether or not to use a slightly simpler version of the camera near point derivation (default is true)
Definition at line 228 of file OgreShadowCameraSetupLiSPSM.h.
| void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | [inherited] |
Definition at line 96 of file OgreMemoryAllocatedObject.h.
| void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, |
| void * | |||
| ) | [inherited] |
Definition at line 102 of file OgreMemoryAllocatedObject.h.
| void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, |
| const char * | , | ||
| int | , | ||
| const char * | |||
| ) | [inherited] |
Definition at line 108 of file OgreMemoryAllocatedObject.h.
| void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | [inherited] |
Definition at line 113 of file OgreMemoryAllocatedObject.h.
| void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr, |
| const char * | , | ||
| int | , | ||
| const char * | |||
| ) | [inherited] |
Definition at line 119 of file OgreMemoryAllocatedObject.h.
| void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, |
| const char * | file, | ||
| int | line, | ||
| const char * | func | ||
| ) | [inherited] |
operator new, with debug line info
Definition at line 68 of file OgreMemoryAllocatedObject.h.
| void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | [inherited] |
Definition at line 73 of file OgreMemoryAllocatedObject.h.
| void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, |
| void * | ptr | ||
| ) | [inherited] |
placement operator new
Definition at line 79 of file OgreMemoryAllocatedObject.h.
| void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz, |
| const char * | file, | ||
| int | line, | ||
| const char * | func | ||
| ) | [inherited] |
array operator new, with debug line info
Definition at line 86 of file OgreMemoryAllocatedObject.h.
| void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | [inherited] |
Definition at line 91 of file OgreMemoryAllocatedObject.h.
| virtual void Ogre::LiSPSMShadowCameraSetup::setCameraLightDirectionThreshold | ( | Degree | angle | ) | [virtual] |
Sets the threshold between the camera and the light direction below which the LiSPSM projection is 'flattened', since coincident light and camera projections cause problems with the perspective skew.
| virtual void Ogre::LiSPSMShadowCameraSetup::setOptimalAdjustFactor | ( | Real | n | ) | [virtual] |
Adjusts the parameter n to produce optimal shadows.
| n | The adjustment factor - default is 0.1f. |
Definition at line 216 of file OgreShadowCameraSetupLiSPSM.h.
| void Ogre::FocusedShadowCameraSetup::setUseAggressiveFocusRegion | ( | bool | aggressive | ) | [inherited] |
Sets whether or not to use the more aggressive approach to deciding on the focus region or not.
| aggressive | True to use the more aggressive approach, false otherwise. |
Definition at line 303 of file OgreShadowCameraSetupFocused.h.
| virtual void Ogre::LiSPSMShadowCameraSetup::setUseSimpleOptimalAdjust | ( | bool | s | ) | [virtual] |
Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true)
Definition at line 224 of file OgreShadowCameraSetupLiSPSM.h.
| Matrix4 Ogre::FocusedShadowCameraSetup::transformToUnitCube | ( | const Matrix4 & | m, |
| const PointListBody & | body | ||
| ) | const [protected, inherited] |
Transforms a given body to the unit cube (-1,-1,-1) / (+1,+1,+1) with a specific shadow matrix enabled.
| m | Transformation matrix applied on the point list body. |
| body | Contains the points of the extends of all valid scene elements which are mapped to the unit cube. |
ConvexBody Ogre::FocusedShadowCameraSetup::mBodyB [mutable, protected, inherited] |
Definition at line 145 of file OgreShadowCameraSetupFocused.h.
Threshold (cos angle) within which to start increasing the opt adjust as camera direction approaches light direction.
Definition at line 108 of file OgreShadowCameraSetupLiSPSM.h.
Camera* Ogre::FocusedShadowCameraSetup::mLightFrustumCamera [protected, inherited] |
Temporary preallocated camera to set up a light frustum for clipping in FocusedShadowCameraSetup::calculateB.
Definition at line 78 of file OgreShadowCameraSetupFocused.h.
bool Ogre::FocusedShadowCameraSetup::mLightFrustumCameraCalculated [mutable, protected, inherited] |
Definition at line 79 of file OgreShadowCameraSetupFocused.h.
Real Ogre::LiSPSMShadowCameraSetup::mOptAdjustFactor [protected] |
Warp factor adjustment.
Definition at line 102 of file OgreShadowCameraSetupLiSPSM.h.
Real Ogre::LiSPSMShadowCameraSetup::mOptAdjustFactorTweak [mutable, protected] |
Extra calculated warp factor.
Definition at line 106 of file OgreShadowCameraSetupLiSPSM.h.
PointListBody Ogre::FocusedShadowCameraSetup::mPointListBodyB [mutable, protected, inherited] |
Definition at line 146 of file OgreShadowCameraSetupFocused.h.
PointListBody Ogre::FocusedShadowCameraSetup::mPointListBodyLVS [mutable, protected, inherited] |
Definition at line 147 of file OgreShadowCameraSetupFocused.h.
const Matrix4 Ogre::FocusedShadowCameraSetup::msLightSpaceToNormal [static, protected, inherited] |
Definition at line 69 of file OgreShadowCameraSetupFocused.h.
const Matrix4 Ogre::FocusedShadowCameraSetup::msNormalToLightSpace [static, protected, inherited] |
Transform to or from light space as defined by Wimmer et al.
Definition at line 68 of file OgreShadowCameraSetupFocused.h.
Frustum* Ogre::FocusedShadowCameraSetup::mTempFrustum [protected, inherited] |
Temporary preallocated frustum to set up a projection matrix in calculateShadowMappingMatrix().
Definition at line 74 of file OgreShadowCameraSetupFocused.h.
bool Ogre::FocusedShadowCameraSetup::mUseAggressiveRegion [protected, inherited] |
Use tighter focus region?
Definition at line 82 of file OgreShadowCameraSetupFocused.h.
bool Ogre::LiSPSMShadowCameraSetup::mUseSimpleNOpt [protected] |
Use simple nopt derivation?
Definition at line 104 of file OgreShadowCameraSetupLiSPSM.h.
Copyright © 2012 Torus Knot Software Ltd

This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Mon Jul 27 2020 13:41:19