#include <OgreShadowCameraSetupPSSM.h>
Inheritance diagram for Ogre::PSSMShadowCameraSetup:
Public Types | |
typedef std::vector< Real > | SplitPointList |
typedef std::vector< Real > | OptimalAdjustFactorList |
Public Member Functions | |
PSSMShadowCameraSetup () | |
Constructor, defaults to 3 splits. | |
~PSSMShadowCameraSetup () | |
void | calculateSplitPoints (size_t splitCount, Real nearDist, Real farDist, Real lambda=0.95) |
Calculate a new splitting scheme. | |
void | setSplitPoints (const SplitPointList &newSplitPoints) |
Manually configure a new splitting scheme. | |
void | setOptimalAdjustFactor (size_t splitIndex, Real factor) |
Set the LiSPSM optimal adjust factor for a given split (call after configuring splits). | |
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'. | |
Real | getSplitPadding () const |
Get the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'. | |
size_t | getSplitCount () const |
Get the number of splits. | |
virtual void | getShadowCamera (const Ogre::SceneManager *sm, const Ogre::Camera *cam, const Ogre::Viewport *vp, const Ogre::Light *light, Ogre::Camera *texCam, size_t iteration) const |
Returns a LiSPSM shadow camera with PSSM splits base on iteration. | |
const SplitPointList & | getSplitPoints () const |
Returns the calculated split points. | |
Real | getOptimalAdjustFactor (size_t splitIndex) const |
Returns the optimal adjust factor for a given split. | |
Real | getOptimalAdjustFactor () const |
Overridden, recommended internal use only since depends on current iteration. | |
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. | |
virtual void | setOptimalAdjustFactor (Real n) |
Adjusts the parameter n to produce optimal shadows. | |
virtual void | setUseSimpleOptimalAdjust (bool s) |
Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true). | |
virtual bool | getUseSimpleOptimalAdjust () const |
Gets whether or not to use a slightly simpler version of the camera near point derivation (default is true). | |
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 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. | |
void | setUseAggressiveFocusRegion (bool aggressive) |
Sets whether or not to use the more aggressive approach to deciding on the focus region or not. | |
bool | getUseAggressiveFocusRegion () const |
AllocatedObject () | |
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) |
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 *) |
Protected Member Functions | |
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. | |
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. | |
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. | |
Matrix4 | buildFrustumProjection (Real left, Real right, Real bottom, Real top, Real near, Real far) const |
Builds a frustum matrix. | |
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. | |
void | calculateB (const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, PointListBody *out_bodyB) const |
Calculates the intersection bodyB. | |
void | calculateLVS (const SceneManager &sm, const Camera &cam, const Light &light, const AxisAlignedBox &sceneBB, PointListBody *out_LVS) const |
Calculates the bodyLVS. | |
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. | |
Matrix4 | buildViewMatrix (const Vector3 &pos, const Vector3 &dir, const Vector3 &up) const |
Builds a view matrix. | |
Protected Attributes | |
size_t | mSplitCount |
SplitPointList | mSplitPoints |
OptimalAdjustFactorList | mOptimalAdjustFactors |
Real | mSplitPadding |
size_t | mCurrentIteration |
Real | mOptAdjustFactor |
Warp factor adjustment. | |
bool | mUseSimpleNOpt |
Use simple nopt derivation? | |
Real | mOptAdjustFactorTweak |
Extra calculated warp factor. | |
Real | mCosCamLightDirThreshold |
Threshold (cos angle) within which to start increasing the opt adjust as camera direction approaches light direction. | |
Frustum * | mTempFrustum |
Temporary preallocated frustum to set up a projection matrix in ::calculateShadowMappingMatrix(). | |
Camera * | mLightFrustumCamera |
Temporary preallocated camera to set up a light frustum for clipping in ::calculateB. | |
bool | mLightFrustumCameraCalculated |
bool | mUseAggressiveRegion |
Use tighter focus region? | |
ConvexBody | mBodyB |
PointListBody | mPointListBodyB |
PointListBody | mPointListBodyLVS |
Static Protected Attributes | |
static const Matrix4 | msNormalToLightSpace |
Transform to or from light space as defined by Wimmer et al. | |
static const Matrix4 | msLightSpaceToNormal |
Definition at line 50 of file OgreShadowCameraSetupPSSM.h.
|
Definition at line 54 of file OgreShadowCameraSetupPSSM.h. |
|
Definition at line 53 of file OgreShadowCameraSetupPSSM.h. |
|
Constructor, defaults to 3 splits.
|
|
|
|
Definition at line 55 of file OgreMemoryAllocatedObject.h. |
|
Builds a frustum matrix.
|
|
Builds a view matrix.
|
|
Calculates the intersection bodyB.
|
|
Calculates the LiSPSM projection matrix P.
|
|
Calculates the bodyLVS.
|
|
Calculates the distance between camera position and near clipping plane.
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
|
|
Calculates a simpler version than the one above.
|
|
Calculates the standard shadow mapping matrix.
|
|
Calculate a new splitting scheme.
|
|
Calculates the visible point on the near plane for the n_opt calculation.
|
|
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.
|
|
Returns the projection view direction.
|
|
Returns a valid near-point seen by the camera.
|
|
Overridden, recommended internal use only since depends on current iteration.
Reimplemented from Ogre::LiSPSMShadowCameraSetup. |
|
Returns the optimal adjust factor for a given split.
Definition at line 111 of file OgreShadowCameraSetupPSSM.h. |
|
Returns a LiSPSM shadow camera.
Reimplemented from Ogre::FocusedShadowCameraSetup. |
|
Returns a LiSPSM shadow camera with PSSM splits base on iteration.
|
|
Get the number of splits.
Definition at line 100 of file OgreShadowCameraSetupPSSM.h. |
|
Get the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.
Definition at line 98 of file OgreShadowCameraSetupPSSM.h. |
|
Returns the calculated split points.
Definition at line 107 of file OgreShadowCameraSetupPSSM.h. |
|
Definition at line 274 of file OgreShadowCameraSetupFocused.h. |
|
Gets whether or not to use a slightly simpler version of the camera near point derivation (default is true).
Definition at line 223 of file OgreShadowCameraSetupLiSPSM.h. |
|
Definition at line 101 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 95 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 89 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 112 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 106 of file OgreMemoryAllocatedObject.h. |
|
placement operator new
Definition at line 73 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 67 of file OgreMemoryAllocatedObject.h. |
|
operator new, with debug line info
Definition at line 62 of file OgreMemoryAllocatedObject.h. |
|
Definition at line 84 of file OgreMemoryAllocatedObject.h. |
|
array operator new, with debug line info
Definition at line 79 of file OgreMemoryAllocatedObject.h. |
|
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.
|
|
Adjusts the parameter n to produce optimal shadows.
Definition at line 211 of file OgreShadowCameraSetupLiSPSM.h. |
|
Set the LiSPSM optimal adjust factor for a given split (call after configuring splits).
|
|
Set the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.
Definition at line 93 of file OgreShadowCameraSetupPSSM.h. |
|
Manually configure a new splitting scheme.
|
|
Sets whether or not to use the more aggressive approach to deciding on the focus region or not.
Definition at line 272 of file OgreShadowCameraSetupFocused.h. |
|
Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true).
Definition at line 219 of file OgreShadowCameraSetupLiSPSM.h. |
|
Transforms a given body to the unit cube (-1,-1,-1) / (+1,+1,+1) with a specific shadow matrix enabled.
|
|
Definition at line 139 of file OgreShadowCameraSetupFocused.h. |
|
Threshold (cos angle) within which to start increasing the opt adjust as camera direction approaches light direction.
Definition at line 103 of file OgreShadowCameraSetupLiSPSM.h. |
|
Definition at line 62 of file OgreShadowCameraSetupPSSM.h. |
|
Temporary preallocated camera to set up a light frustum for clipping in ::calculateB.
Definition at line 72 of file OgreShadowCameraSetupFocused.h. |
|
Definition at line 73 of file OgreShadowCameraSetupFocused.h. |
|
Warp factor adjustment.
Definition at line 97 of file OgreShadowCameraSetupLiSPSM.h. |
|
Extra calculated warp factor.
Definition at line 101 of file OgreShadowCameraSetupLiSPSM.h. |
|
Definition at line 59 of file OgreShadowCameraSetupPSSM.h. |
|
Definition at line 140 of file OgreShadowCameraSetupFocused.h. |
|
Definition at line 141 of file OgreShadowCameraSetupFocused.h. |
|
Definition at line 63 of file OgreShadowCameraSetupFocused.h. |
|
Transform to or from light space as defined by Wimmer et al.
Definition at line 62 of file OgreShadowCameraSetupFocused.h. |
|
Definition at line 57 of file OgreShadowCameraSetupPSSM.h. |
|
Definition at line 60 of file OgreShadowCameraSetupPSSM.h. |
|
Definition at line 58 of file OgreShadowCameraSetupPSSM.h. |
|
Temporary preallocated frustum to set up a projection matrix in ::calculateShadowMappingMatrix().
Definition at line 68 of file OgreShadowCameraSetupFocused.h. |
|
Use tighter focus region?
Definition at line 76 of file OgreShadowCameraSetupFocused.h. |
|
Use simple nopt derivation?
Definition at line 99 of file OgreShadowCameraSetupLiSPSM.h. |
Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sat Apr 11 13:54:17 2009