Project

General

Profile

SO3Engine

#include <SO3ShadowCSM.h>

Inheritance diagram for SO3::StableCSMShadowCameraSetup:

Public Types

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

Public Member Functions

 StableCSMShadowCameraSetup (Ogre::SceneManager *ogreScene, CSMGpuConstants *constants)
 
 ~StableCSMShadowCameraSetup ()
 
void calculateSplitPoints (size_t cascadeCount, Ogre::Real firstSplitDist, Ogre::Real farDist, Ogre::Real lambda=0.95)
 
void setSplitPoints (const SplitPointList &newSplitPoints)
 
void setSplitPadding (Ogre::Real pad)
 
Ogre::Real getSplitPadding () const
 
size_t getCascadeCount () 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 stable CSM shadow camera for the given iteration.
 
const SplitPointListgetSplitPoints () const
 Returns the calculated split points.
 

Protected Member Functions

void getShadowCameraForCascade (const Ogre::SceneManager *sm, const Ogre::Camera *cam, const Ogre::Viewport *vp, const Ogre::Light *light, Ogre::Camera *texCam, size_t iteration, Ogre::Real nearSplit, Ogre::Real farSplit) const
 

Protected Attributes

size_t mCascadeCount
 
SplitPointList mSplitPoints
 
Ogre::Real mSplitPadding
 
size_t mCurrentIteration
 

Detailed Description

Definition at line 71 of file SO3ShadowCSM.h.

Member Typedef Documentation

◆ SplitPointList

typedef std::vector<Ogre::Real> SO3::StableCSMShadowCameraSetup::SplitPointList

Definition at line 74 of file SO3ShadowCSM.h.

Constructor & Destructor Documentation

◆ StableCSMShadowCameraSetup()

SO3::StableCSMShadowCameraSetup::StableCSMShadowCameraSetup ( Ogre::SceneManager *  ogreScene,
CSMGpuConstants constants 
)

Definition at line 386 of file SO3ShadowCSM.cpp.

◆ ~StableCSMShadowCameraSetup()

SO3::StableCSMShadowCameraSetup::~StableCSMShadowCameraSetup ( )

Definition at line 393 of file SO3ShadowCSM.cpp.

Member Function Documentation

◆ calculateSplitPoints()

void SO3::StableCSMShadowCameraSetup::calculateSplitPoints ( size_t  cascadeCount,
Ogre::Real  firstSplitDist,
Ogre::Real  farDist,
Ogre::Real  lambda = 0.95 
)

Calculate a new splitting scheme.

Parameters
cascadeCountThe number of cascades to use
firstSplitDistdistance of the first split
farDistThe far plane to use for the last split
lambdaValue between 0 (linear splits) and 1 (logarithmic splits)

Definition at line 397 of file SO3ShadowCSM.cpp.

◆ getCascadeCount()

size_t SO3::StableCSMShadowCameraSetup::getCascadeCount ( ) const
inline

Get the number of splits.

Definition at line 103 of file SO3ShadowCSM.h.

◆ getShadowCamera()

void SO3::StableCSMShadowCameraSetup::getShadowCamera ( const Ogre::SceneManager *  sm,
const Ogre::Camera *  cam,
const Ogre::Viewport *  vp,
const Ogre::Light *  light,
Ogre::Camera *  texCam,
size_t  iteration 
) const
virtual

Returns a stable CSM shadow camera for the given iteration.

Definition at line 428 of file SO3ShadowCSM.cpp.

◆ getShadowCameraForCascade()

void SO3::StableCSMShadowCameraSetup::getShadowCameraForCascade ( const Ogre::SceneManager *  sm,
const Ogre::Camera *  cam,
const Ogre::Viewport *  vp,
const Ogre::Light *  light,
Ogre::Camera *  texCam,
size_t  iteration,
Ogre::Real  nearSplit,
Ogre::Real  farSplit 
) const
protected

Definition at line 452 of file SO3ShadowCSM.cpp.

◆ getSplitPadding()

Ogre::Real SO3::StableCSMShadowCameraSetup::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 101 of file SO3ShadowCSM.h.

◆ getSplitPoints()

const SplitPointList & SO3::StableCSMShadowCameraSetup::getSplitPoints ( ) const
inline

Returns the calculated split points.

Definition at line 110 of file SO3ShadowCSM.h.

◆ setSplitPadding()

void SO3::StableCSMShadowCameraSetup::setSplitPadding ( Ogre::Real  pad)
inline

Definition at line 96 of file SO3ShadowCSM.h.

◆ setSplitPoints()

void SO3::StableCSMShadowCameraSetup::setSplitPoints ( const SplitPointList newSplitPoints)

Manually configure a new splitting scheme.

Parameters
newSplitPointsA list which is cascadeCount + 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.

Definition at line 419 of file SO3ShadowCSM.cpp.

Member Data Documentation

◆ mCascadeCount

size_t SO3::StableCSMShadowCameraSetup::mCascadeCount
protected

Definition at line 119 of file SO3ShadowCSM.h.

◆ mCurrentIteration

size_t SO3::StableCSMShadowCameraSetup::mCurrentIteration
mutableprotected

Definition at line 123 of file SO3ShadowCSM.h.

◆ mSplitPadding

Ogre::Real SO3::StableCSMShadowCameraSetup::mSplitPadding
protected

Definition at line 121 of file SO3ShadowCSM.h.

◆ mSplitPoints

SplitPointList SO3::StableCSMShadowCameraSetup::mSplitPoints
protected

Definition at line 120 of file SO3ShadowCSM.h.


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