OgreShadowCameraSetupLiSPSM.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 __ShadowCameraSetupLiSPSM_H__
#define __ShadowCameraSetupLiSPSM_H__
#include "OgrePrerequisites.h"
#include "OgreShadowCameraSetupFocused.h"
#include "OgreHeaderPrefix.h"
namespace Ogre
{
class _OgreExport LiSPSMShadowCameraSetup : public FocusedShadowCameraSetup
{
protected:
Real mOptAdjustFactor;
bool mUseSimpleNOpt;
mutable Real mOptAdjustFactorTweak;
Real mCosCamLightDirThreshold;
Matrix4 calculateLiSPSM(const Matrix4& lightSpace, const PointListBody& bodyB,
const PointListBody& bodyLVS, const SceneManager& sm,
const Camera& cam, const Light& light) const;
Real calculateNOpt(const Matrix4& lightSpace, const AxisAlignedBox& bodyBABB_ls,
const PointListBody& bodyLVS, const Camera& cam) const;
Real calculateNOptSimple(const PointListBody& bodyLVS,
const Camera& cam) const;
Vector3 calculateZ0_ls(const Matrix4& lightSpace, const Vector3& e, Real bodyB_zMax_ls,
const Camera& cam) const;
Matrix4 buildFrustumProjection(Real left, Real right, Real bottom,
Real top, Real near, Real far) const;
public:
LiSPSMShadowCameraSetup(void);
virtual ~LiSPSMShadowCameraSetup(void);
virtual void getShadowCamera(const SceneManager *sm, const Camera *cam,
const Viewport *vp, const Light *light, Camera *texCam, size_t iteration) const;
virtual void setOptimalAdjustFactor(Real n) { mOptAdjustFactor = n; }
virtual Real getOptimalAdjustFactor() const { return mOptAdjustFactor; }
virtual void setUseSimpleOptimalAdjust(bool s) { mUseSimpleNOpt = s; }
virtual bool getUseSimpleOptimalAdjust() const { return mUseSimpleNOpt; }
virtual void setCameraLightDirectionThreshold(Degree angle);
virtual Degree getCameraLightDirectionThreshold() const;
};
}
#include "OgreHeaderSuffix.h"
#endif
Ogre::LiSPSMShadowCameraSetup::mOptAdjustFactorTweak
Real mOptAdjustFactorTweak
Extra calculated warp factor.
Definition: OgreShadowCameraSetupLiSPSM.h:106
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::LiSPSMShadowCameraSetup::setUseSimpleOptimalAdjust
virtual void setUseSimpleOptimalAdjust(bool s)
Sets whether or not to use a slightly simpler version of the camera near point derivation (default is...
Definition: OgreShadowCameraSetupLiSPSM.h:224
Ogre::LiSPSMShadowCameraSetup::getUseSimpleOptimalAdjust
virtual bool getUseSimpleOptimalAdjust() const
Gets whether or not to use a slightly simpler version of the camera near point derivation (default is...
Definition: OgreShadowCameraSetupLiSPSM.h:228
Ogre::Real
float Real
Software floating point type.
Definition: OgrePrerequisites.h:70
Ogre::LiSPSMShadowCameraSetup::mUseSimpleNOpt
bool mUseSimpleNOpt
Use simple nopt derivation?
Definition: OgreShadowCameraSetupLiSPSM.h:104
Ogre::Viewport
An abstraction of a viewport, i.e.
Definition: OgreViewport.h:57
Ogre::Matrix4
Class encapsulating a standard 4x4 homogeneous matrix.
Definition: OgreMatrix4.h:78
Ogre::Vector3
Standard 3-dimensional vector.
Definition: OgreVector3.h:51
OgrePrerequisites.h
Ogre::LiSPSMShadowCameraSetup::mOptAdjustFactor
Real mOptAdjustFactor
Warp factor adjustment.
Definition: OgreShadowCameraSetupLiSPSM.h:102
Ogre::Camera
A viewpoint from which the scene will be rendered.
Definition: OgreCamera.h:86
OgreHeaderSuffix.h
Ogre::LiSPSMShadowCameraSetup::setOptimalAdjustFactor
virtual void setOptimalAdjustFactor(Real n)
Adjusts the parameter n to produce optimal shadows.
Definition: OgreShadowCameraSetupLiSPSM.h:216
Ogre
Definition: OgreAndroidLogListener.h:34
OgreHeaderPrefix.h
Ogre::FocusedShadowCameraSetup
Implements the uniform shadow mapping algorithm in focused mode.
Definition: OgreShadowCameraSetupFocused.h:58
Ogre::Degree
Wrapper class which indicates a given angle value is in Degrees.
Definition: OgreMath.h:98
Ogre::LiSPSMShadowCameraSetup::getOptimalAdjustFactor
virtual Real getOptimalAdjustFactor() const
Get the parameter n used to produce optimal shadows.
Definition: OgreShadowCameraSetupLiSPSM.h:220
Ogre::AxisAlignedBox
A 3D box aligned with the x/y/z axes.
Definition: OgreAxisAlignedBox.h:54
OgreShadowCameraSetupFocused.h
Ogre::SceneManager
Manages the organisation and rendering of a &#39;scene&#39; i.e.
Definition: OgreSceneManager.h:143
Ogre::FocusedShadowCameraSetup::PointListBody
Internal class holding a point list representation of a convex body.
Definition: OgreShadowCameraSetupFocused.h:86
Ogre::LiSPSMShadowCameraSetup::mCosCamLightDirThreshold
Real mCosCamLightDirThreshold
Threshold (cos angle) within which to start increasing the opt adjust as camera direction approaches ...
Definition: OgreShadowCameraSetupLiSPSM.h:108
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.