OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::FocusedShadowCameraSetup Class Reference

Implements the uniform shadow mapping algorithm in focused mode. More...

#include <OgreShadowCameraSetupFocused.h>

+ Inheritance diagram for Ogre::FocusedShadowCameraSetup:

Public Member Functions

 FocusedShadowCameraSetup ()
 Default constructor. More...
 
 ~FocusedShadowCameraSetup () override
 Default destructor. More...
 
void getShadowCamera (const SceneManager *sm, const Camera *cam, const Light *light, Camera *texCam, size_t iteration, const Vector2 &viewportRealSize) const override
 Returns a uniform shadow camera with a focused view. More...
 
Real getXYPadding () const
 See FocusedShadowCameraSetup::setXYPadding. More...
 
void setXYPadding (Real pad)
 setXYPadding FocusedShadowCameraSetup tries to make the shadow mapping camera fit the casters as tight as possible to minimize aliasing. More...
 
- Public Member Functions inherited from Ogre::DefaultShadowCameraSetup
 DefaultShadowCameraSetup ()
 Default constructor. More...
 
 ~DefaultShadowCameraSetup () override
 Destructor. More...
 
- Public Member Functions inherited from Ogre::ShadowCameraSetup
 ShadowCameraSetup ()
 
virtual ~ShadowCameraSetup ()
 Need virtual destructor in case subclasses use it. More...
 
Real getMaxDistance () const
 
Real getMinDistance () const
 

Additional Inherited Members

- Static Public Member Functions inherited from Ogre::ShadowCameraSetup
static void setUseEsm (bool useEsm)
 

Detailed Description

Implements the uniform shadow mapping algorithm in focused mode.

Remarks
Differs from the default shadow mapping projection in that it focuses the shadow map on the visible areas of the scene. This results in better shadow map texel usage, at the expense of some 'swimming' of the shadow texture on receivers as the basis is constantly being reevaluated.
Note
Original implementation by Matthias Fink matth.nosp@m.ias..nosp@m.fink@.nosp@m.web..nosp@m.de, 2006.

Constructor & Destructor Documentation

◆ FocusedShadowCameraSetup()

Ogre::FocusedShadowCameraSetup::FocusedShadowCameraSetup ( )

Default constructor.

Remarks
Temporary frustum and camera set up here.

◆ ~FocusedShadowCameraSetup()

Ogre::FocusedShadowCameraSetup::~FocusedShadowCameraSetup ( )
override

Default destructor.

Remarks
Temporary frustum and camera destroyed here.

Member Function Documentation

◆ getShadowCamera()

void Ogre::FocusedShadowCameraSetup::getShadowCamera ( const SceneManager sm,
const Camera cam,
const Light light,
Camera texCam,
size_t  iteration,
const Vector2 viewportRealSize 
) const
overridevirtual

Returns a uniform shadow camera with a focused view.

Reimplemented from Ogre::DefaultShadowCameraSetup.

Reimplemented in Ogre::PSSMShadowCameraSetup.

◆ getXYPadding()

Real Ogre::FocusedShadowCameraSetup::getXYPadding ( ) const
inline

◆ setXYPadding()

void Ogre::FocusedShadowCameraSetup::setXYPadding ( Real  pad)
inline

setXYPadding FocusedShadowCameraSetup tries to make the shadow mapping camera fit the casters as tight as possible to minimize aliasing.

But due to various math issues sometimes it ends up being too tight.

If you experience missing shadows or with gaps/holes you may need to increase the padding.

Most likely you want the reverse. In particular circumstances you want maximum quality thus you want to minimize this padding

Parameters
padValue in range [0; inf) Negative values may cause glitches

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