OGRE
1.11.6
Object-Oriented Graphics Rendering Engine
|
Parallel Split Shadow Map (PSSM) shadow camera setup. More...
#include <OgreShadowCameraSetupPSSM.h>
Public Types | |
typedef std::vector< Real > | OptimalAdjustFactorList |
typedef std::vector< Real > | SplitPointList |
Public Member Functions | |
PSSMShadowCameraSetup () | |
virtual | ~PSSMShadowCameraSetup () |
void | calculateSplitPoints (uint splitCount, Real nearDist, Real farDist, Real lambda=0.95f) |
Calculate a new splitting scheme. More... | |
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. More... | |
Real | getOptimalAdjustFactor (size_t splitIndex) const |
Returns the optimal adjust factor for a given split. More... | |
Real | getOptimalAdjustFactor () const |
Overridden, recommended internal use only since depends on current iteration. More... | |
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. 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 SplitPointList & | getSplitPoints () const |
Returns the calculated split points. More... | |
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) More... | |
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. More... | |
void | setOptimalAdjustFactor (size_t splitIndex, Real factor) |
Set the LiSPSM optimal adjust factor for a given split (call after configuring splits). More... | |
virtual void | setOptimalAdjustFactor (Real n) |
Adjusts the parameter n to produce optimal shadows. 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... | |
void | setUseAggressiveFocusRegion (bool aggressive) |
Sets whether or not to use the more aggressive approach to deciding on the focus region or not. More... | |
virtual void | setUseSimpleOptimalAdjust (bool s) |
Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true) More... | |
Static Public Member Functions | |
static ShadowCameraSetupPtr | create () |
Constructor, defaults to 3 splits. More... | |
static ShadowCameraSetupPtr | create (Real n=0.1f, bool useSimpleNOpt=true, Degree angle=Radian(0.451)) |
static ShadowCameraSetupPtr | create (bool useAggressiveRegion=true) |
Create an instance. More... | |
Parallel Split Shadow Map (PSSM) shadow camera setup.
typedef std::vector<Real> Ogre::PSSMShadowCameraSetup::SplitPointList |
typedef std::vector<Real> Ogre::PSSMShadowCameraSetup::OptimalAdjustFactorList |
Ogre::PSSMShadowCameraSetup::PSSMShadowCameraSetup | ( | ) |
|
virtual |
|
inlinestatic |
Constructor, defaults to 3 splits.
void Ogre::PSSMShadowCameraSetup::calculateSplitPoints | ( | uint | splitCount, |
Real | nearDist, | ||
Real | farDist, | ||
Real | lambda = 0.95f |
||
) |
Calculate a new splitting scheme.
splitCount | The number of splits to use |
nearDist | The near plane to use for the first split |
farDist | The far plane to use for the last split |
lambda | Factor to use to reduce the split size |
void Ogre::PSSMShadowCameraSetup::setSplitPoints | ( | const SplitPointList & | newSplitPoints | ) |
Manually configure a new splitting scheme.
newSplitPoints | A 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. |
void Ogre::PSSMShadowCameraSetup::setOptimalAdjustFactor | ( | size_t | splitIndex, |
Real | factor | ||
) |
Set the LiSPSM optimal adjust factor for a given split (call after configuring splits).
|
inline |
Set the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.
|
inline |
Get the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.
|
inline |
Get the number of splits.
|
virtual |
Returns a LiSPSM shadow camera with PSSM splits base on iteration.
Reimplemented from Ogre::LiSPSMShadowCameraSetup.
|
inline |
Returns the calculated split points.
|
inline |
Returns the optimal adjust factor for a given split.
|
virtual |
Overridden, recommended internal use only since depends on current iteration.
Reimplemented from Ogre::LiSPSMShadowCameraSetup.
|
inlinestaticinherited |
n | The adjustment factor |
useSimpleNOpt | |
angle | camera Light Direction Threshold |
|
inlinestaticinherited |
Create an instance.
There are 2 approaches that can be used to define the focus region, the more aggressive way introduced by Wimmer et al, or the original way as described in Stamminger et al. Wimmer et al's way tends to come up with a tighter focus region but in rare cases (mostly highly glancing angles) can cause some shadow casters to be clipped incorrectly. By default the more aggressive approach is used since it leads to significantly better results in most cases, but if you experience clipping issues, you can use the less aggressive version.
aggressive | True to use the more aggressive approach, false otherwise. |
|
inlinevirtualinherited |
Adjusts the parameter n to produce optimal shadows.
n | The adjustment factor - default is 0.1f. |
|
inlinevirtualinherited |
Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true)
|
inlinevirtualinherited |
Gets whether or not to use a slightly simpler version of the camera near point derivation (default is true)
|
virtualinherited |
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.
|
virtualinherited |
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.
|
inlineinherited |
Sets whether or not to use the more aggressive approach to deciding on the focus region or not.
|
inlineinherited |