OgreShadowCameraSetupPSSM.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Copyright (c) 2006 Matthias Fink, netAllied GmbH <matthias.fink@web.de>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __ShadowCameraSetupPSSM_H__
#define __ShadowCameraSetupPSSM_H__
#include "OgrePrerequisites.h"
#include "OgreShadowCameraSetupLiSPSM.h"
#include "OgreHeaderPrefix.h"
namespace Ogre
{
class _OgreExport PSSMShadowCameraSetup : public Ogre::LiSPSMShadowCameraSetup
{
public:
typedef vector<Real>::type SplitPointList;
typedef vector<Real>::type OptimalAdjustFactorList;
protected:
uint mSplitCount;
SplitPointList mSplitPoints;
OptimalAdjustFactorList mOptimalAdjustFactors;
Real mSplitPadding;
mutable size_t mCurrentIteration;
public:
PSSMShadowCameraSetup();
~PSSMShadowCameraSetup();
void calculateSplitPoints(uint splitCount, Real nearDist, Real farDist, Real lambda = 0.95);
void setSplitPoints(const SplitPointList& newSplitPoints);
void setOptimalAdjustFactor(size_t splitIndex, Real factor);
void setSplitPadding(Real pad) { mSplitPadding = pad; }
Real getSplitPadding() const { return mSplitPadding; }
uint getSplitCount() const { return mSplitCount; }
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;
inline const SplitPointList& getSplitPoints() const
{ return mSplitPoints; }
inline Real getOptimalAdjustFactor(size_t splitIndex) const
{ return mOptimalAdjustFactors[splitIndex]; }
Real getOptimalAdjustFactor() const;
};
}
#include "OgreHeaderSuffix.h"
#endif
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::uint
unsigned int uint
Definition: OgrePrerequisites.h:114
Ogre::PSSMShadowCameraSetup::mSplitPoints
SplitPointList mSplitPoints
Definition: OgreShadowCameraSetupPSSM.h:64
Ogre::PSSMShadowCameraSetup
Parallel Split Shadow Map (PSSM) shadow camera setup.
Definition: OgreShadowCameraSetupPSSM.h:56
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::Viewport
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
OgrePrerequisites.h
OgreShadowCameraSetupLiSPSM.h
Ogre::PSSMShadowCameraSetup::mCurrentIteration
size_t mCurrentIteration
Definition: OgreShadowCameraSetupPSSM.h:68
Ogre::PSSMShadowCameraSetup::mSplitCount
uint mSplitCount
Definition: OgreShadowCameraSetupPSSM.h:63
Ogre::PSSMShadowCameraSetup::getSplitPoints
const SplitPointList & getSplitPoints() const
Returns the calculated split points.
Definition: OgreShadowCameraSetupPSSM.h:113
Ogre::PSSMShadowCameraSetup::mOptimalAdjustFactors
OptimalAdjustFactorList mOptimalAdjustFactors
Definition: OgreShadowCameraSetupPSSM.h:65
Ogre::PSSMShadowCameraSetup::getSplitPadding
Real getSplitPadding() const
Get the padding factor to apply to the near & far distances when matching up splits to one another...
Definition: OgreShadowCameraSetupPSSM.h:104
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
OgreHeaderSuffix.h
Ogre::PSSMShadowCameraSetup::OptimalAdjustFactorList
vector< Real >::type OptimalAdjustFactorList
Definition: OgreShadowCameraSetupPSSM.h:60
Ogre::PSSMShadowCameraSetup::SplitPointList
vector< Real >::type SplitPointList
Definition: OgreShadowCameraSetupPSSM.h:59
Ogre
Definition: OgreAndroidLogListener.h:34
Ogre::PSSMShadowCameraSetup::getOptimalAdjustFactor
Real getOptimalAdjustFactor(size_t splitIndex) const
Returns the optimal adjust factor for a given split.
Definition: OgreShadowCameraSetupPSSM.h:117
Ogre::vector
Definition: OgrePrerequisites.h:491
OgreHeaderPrefix.h
Ogre::PSSMShadowCameraSetup::setSplitPadding
void setSplitPadding(Real pad)
Set the padding factor to apply to the near & far distances when matching up splits to one another...
Definition: OgreShadowCameraSetupPSSM.h:99
Ogre::PSSMShadowCameraSetup::getSplitCount
uint getSplitCount() const
Get the number of splits.
Definition: OgreShadowCameraSetupPSSM.h:106
Ogre::PSSMShadowCameraSetup::mSplitPadding
Real mSplitPadding
Definition: OgreShadowCameraSetupPSSM.h:66
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::Light
Representation of a dynamic light source in the scene.
Definition: OgreLight.h:73
Ogre::LiSPSMShadowCameraSetup
Implements the Light Space Perspective Shadow Mapping Algorithm.
Definition: OgreShadowCameraSetupLiSPSM.h:98

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.