OGRE: Ogre::PSSMShadowCameraSetup Class Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::PSSMShadowCameraSetup Class Reference
Core » Scene

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

`#include <OgreShadowCameraSetupPSSM.h>`

Inheritance diagram for Ogre::PSSMShadowCameraSetup:
[legend]

## 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.
Real | getOptimalAdjustFactor () const override
| Overridden, recommended internal use only since depends on current iteration.
Real | getOptimalAdjustFactor (size_t splitIndex) const
| Returns the optimal adjust factor for a given split.
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 override
| Returns a LiSPSM shadow camera with PSSM splits base on iteration.
uint | getSplitCount () const
| Get the number of splits.
Real | getSplitPadding () const
| Get the padding factor to apply to the near & far distances when matching up splits to one another, to avoid 'cracks'.
const SplitPointList & | getSplitPoints () const
| Returns the calculated split points.
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'.
void | setSplitPoints (const SplitPointList &newSplitPoints)
| Manually configure a new splitting scheme.
Public Member Functions inherited from Ogre::LiSPSMShadowCameraSetup
| LiSPSMShadowCameraSetup (Real n=0.1f, bool useSimpleNOpt=true, Degree angle=Radian(0.451f))
virtual | ~LiSPSMShadowCameraSetup ()
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 bool | getUseSimpleOptimalAdjust () const
| Gets whether or not to use a slightly simpler version of the camera near point derivation (default is true).
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 | setUseSimpleOptimalAdjust (bool s)
| Sets whether or not to use a slightly simpler version of the camera near point derivation (default is true).
Public Member Functions inherited from Ogre::FocusedShadowCameraSetup
| FocusedShadowCameraSetup (bool useAggressiveRegion=true)
| ~FocusedShadowCameraSetup ()
bool | getUseAggressiveFocusRegion () const
void | setUseAggressiveFocusRegion (bool aggressive)
| Sets whether or not to use the more aggressive approach to deciding on the focus region or not.
Public Member Functions inherited from Ogre::DefaultShadowCameraSetup
| DefaultShadowCameraSetup ()
virtual | ~DefaultShadowCameraSetup ()
Public Member Functions inherited from Ogre::ShadowCameraSetup
virtual | ~ShadowCameraSetup ()
| Need virtual destructor in case subclasses use it.

## Static Public Member Functions
static ShadowCameraSetupPtr | create ()
| Constructor, defaults to 3 splits.
Static Public Member Functions inherited from Ogre::LiSPSMShadowCameraSetup
static ShadowCameraSetupPtr | create (Real n=0.1f, bool useSimpleNOpt=true, Degree angle=Radian(0.451f))
Static Public Member Functions inherited from Ogre::FocusedShadowCameraSetup
static ShadowCameraSetupPtr | create (bool useAggressiveRegion=true)
| Create an instance.
Static Public Member Functions inherited from Ogre::DefaultShadowCameraSetup
static ShadowCameraSetupPtr | create ()

## Detailed Description

Parallel Split Shadow Map (PSSM) shadow camera setup.

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).

## Member Typedef Documentation

## ◆ SplitPointList

typedef std::vector<Real> Ogre::PSSMShadowCameraSetup::SplitPointList

## ◆ OptimalAdjustFactorList

typedef std::vector<Real> Ogre::PSSMShadowCameraSetup::OptimalAdjustFactorList

## Constructor & Destructor Documentation

## ◆ PSSMShadowCameraSetup()

Ogre::PSSMShadowCameraSetup::PSSMShadowCameraSetup | ( |  | ) |

Deprecated
  use create()

## ◆ ~PSSMShadowCameraSetup()

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

## Member Function Documentation

## ◆ create()

ShadowCameraSetupPtr Ogre::PSSMShadowCameraSetup::create | ( |  | ) |
| inlinestatic

Constructor, defaults to 3 splits.

## ◆ calculateSplitPoints()

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

Calculate a new splitting scheme.

Parameters

  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

## ◆ setSplitPoints()

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

Manually configure a new splitting scheme.

Parameters

  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.

## ◆ setOptimalAdjustFactor()

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

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

## ◆ setSplitPadding()

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'.

## ◆ getSplitPadding()

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'.

## ◆ getSplitCount()

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

Get the number of splits.

## ◆ getShadowCamera()

void Ogre::PSSMShadowCameraSetup::getShadowCamera | ( | const Ogre::SceneManager * | sm,
|  | const Ogre::Camera * | cam,
|  | const Ogre::Viewport * | vp,
|  | const Ogre::Light * | light,
|  | Ogre::Camera * | texCam,
|  | size_t | iteration ) const
| overridevirtual

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

Reimplemented from Ogre::LiSPSMShadowCameraSetup.

## ◆ getSplitPoints()

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

Returns the calculated split points.

## ◆ getOptimalAdjustFactor() [1/2]

Real Ogre::PSSMShadowCameraSetup::getOptimalAdjustFactor | ( | size_t | splitIndex | ) | const
| inline

Returns the optimal adjust factor for a given split.

## ◆ getOptimalAdjustFactor() [2/2]

Real Ogre::PSSMShadowCameraSetup::getOptimalAdjustFactor | ( |  | ) | const
| overridevirtual

Overridden, recommended internal use only since depends on current iteration.

Reimplemented from Ogre::LiSPSMShadowCameraSetup.

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

- OgreShadowCameraSetupPSSM.h