ShadowSettings
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-20 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGSHADOW_SHADOWSETTINGS
#define OSGSHADOW_SHADOWSETTINGS 1
#include <osg/Uniform>
#include <osg/CullSettings>
#include <osgShadow/Export>
namespace osgShadow {
class OSGSHADOW_EXPORT ShadowSettings : public osg::Object
{
public:
ShadowSettings();
ShadowSettings(const ShadowSettings& ss, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgShadow, ShadowSettings);
void setReceivesShadowTraversalMask(unsigned int mask) { _receivesShadowTraversalMask = mask; }
unsigned int getReceivesShadowTraversalMask() const { return _receivesShadowTraversalMask; }
void setCastsShadowTraversalMask(unsigned int mask) { _castsShadowTraversalMask = mask; }
unsigned int getCastsShadowTraversalMask() const { return _castsShadowTraversalMask; }
void setComputeNearFarModeOverride(osg::CullSettings::ComputeNearFarMode cnfn) { _computeNearFearModeOverride = cnfn; }
osg::CullSettings::ComputeNearFarMode getComputeNearFarModeOverride() const { return _computeNearFearModeOverride; }
void setLightNum(int lightNum) { _lightNum = lightNum; }
int getLightNum() const { return _lightNum; }
void setBaseShadowTextureUnit(unsigned int unit) { _baseShadowTextureUnit = unit; }
unsigned int getBaseShadowTextureUnit() const { return _baseShadowTextureUnit; }
void setUseOverrideForShadowMapTexture(bool useOverride) { _useShadowMapTextureOverride = useOverride; }
bool getUseOverrideForShadowMapTexture() const { return _useShadowMapTextureOverride; }
void setTextureSize(const osg::Vec2s& textureSize) { _textureSize = textureSize; }
const osg::Vec2s& getTextureSize() const { return _textureSize; }
void setMinimumShadowMapNearFarRatio(double ratio) { _minimumShadowMapNearFarRatio = ratio; }
double getMinimumShadowMapNearFarRatio() const { return _minimumShadowMapNearFarRatio; }
void setMaximumShadowMapDistance(double distance) { _maximumShadowMapDistance = distance; }
double getMaximumShadowMapDistance() const { return _maximumShadowMapDistance; }
enum ShadowMapProjectionHint
{
ORTHOGRAPHIC_SHADOW_MAP,
PERSPECTIVE_SHADOW_MAP
};
void setShadowMapProjectionHint(ShadowMapProjectionHint hint) { _shadowMapProjectionHint = hint; }
ShadowMapProjectionHint getShadowMapProjectionHint() const { return _shadowMapProjectionHint; }
void setPerspectiveShadowMapCutOffAngle(double angle) { _perspectiveShadowMapCutOffAngle = angle; }
double getPerspectiveShadowMapCutOffAngle() const { return _perspectiveShadowMapCutOffAngle; }
void setNumShadowMapsPerLight(unsigned int numShadowMaps) { _numShadowMapsPerLight = numShadowMaps; }
unsigned int getNumShadowMapsPerLight() const { return _numShadowMapsPerLight; }
enum MultipleShadowMapHint
{
PARALLEL_SPLIT,
CASCADED
};
void setMultipleShadowMapHint(MultipleShadowMapHint hint) { _multipleShadowMapHint = hint; }
MultipleShadowMapHint getMultipleShadowMapHint() const { return _multipleShadowMapHint; }
enum ShaderHint
{
NO_SHADERS,
PROVIDE_FRAGMENT_SHADER,
PROVIDE_VERTEX_AND_FRAGMENT_SHADER
};
void setShaderHint(ShaderHint shaderHint) { _shaderHint = shaderHint; }
ShaderHint getShaderHint() const { return _shaderHint; }
void setDebugDraw(bool debugDraw) { _debugDraw = debugDraw; }
bool getDebugDraw() const { return _debugDraw; }
protected:
virtual ~ShadowSettings();
unsigned int _receivesShadowTraversalMask;
unsigned int _castsShadowTraversalMask;
osg::CullSettings::ComputeNearFarMode _computeNearFearModeOverride;
int _lightNum;
unsigned int _baseShadowTextureUnit;
bool _useShadowMapTextureOverride;
osg::Vec2s _textureSize;
double _minimumShadowMapNearFarRatio;
double _maximumShadowMapDistance;
ShadowMapProjectionHint _shadowMapProjectionHint;
double _perspectiveShadowMapCutOffAngle;
unsigned int _numShadowMapsPerLight;
MultipleShadowMapHint _multipleShadowMapHint;
ShaderHint _shaderHint;
bool _debugDraw;
};
}
#endif
CullSettings
Uniform
osgShadow::ShadowSettings::ShadowSettings
ShadowSettings()
osgShadow::ShadowSettings::getShaderHint
ShaderHint getShaderHint() const
Definition ShadowSettings:112
osgShadow::ShadowSettings::getTextureSize
const osg::Vec2s & getTextureSize() const
Definition ShadowSettings:63
osgShadow::ShadowSettings::setNumShadowMapsPerLight
void setNumShadowMapsPerLight(unsigned int numShadowMaps)
Definition ShadowSettings:91
osgShadow::ShadowSettings::_computeNearFearModeOverride
osg::CullSettings::ComputeNearFarMode _computeNearFearModeOverride
Definition ShadowSettings:125
osgShadow::ShadowSettings::setMinimumShadowMapNearFarRatio
void setMinimumShadowMapNearFarRatio(double ratio)
Definition ShadowSettings:65
osgShadow::ShadowSettings::ShadowSettings
ShadowSettings(const ShadowSettings &ss, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgShadow::ShadowSettings::setDebugDraw
void setDebugDraw(bool debugDraw)
Definition ShadowSettings:114
osgShadow::ShadowSettings::setUseOverrideForShadowMapTexture
void setUseOverrideForShadowMapTexture(bool useOverride)
Definition ShadowSettings:53
osgShadow::ShadowSettings::getShadowMapProjectionHint
ShadowMapProjectionHint getShadowMapProjectionHint() const
Definition ShadowSettings:79
osgShadow::ShadowSettings::~ShadowSettings
virtual ~ShadowSettings()
osgShadow::ShadowSettings::setShadowMapProjectionHint
void setShadowMapProjectionHint(ShadowMapProjectionHint hint)
Definition ShadowSettings:78
osgShadow::ShadowSettings::_minimumShadowMapNearFarRatio
double _minimumShadowMapNearFarRatio
Definition ShadowSettings:132
osgShadow::ShadowSettings::_shadowMapProjectionHint
ShadowMapProjectionHint _shadowMapProjectionHint
Definition ShadowSettings:134
osgShadow::ShadowSettings::setCastsShadowTraversalMask
void setCastsShadowTraversalMask(unsigned int mask)
Definition ShadowSettings:35
osgShadow::ShadowSettings::setLightNum
void setLightNum(int lightNum)
Definition ShadowSettings:45
osgShadow::ShadowSettings::_debugDraw
bool _debugDraw
Definition ShadowSettings:141
osgShadow::ShadowSettings::getCastsShadowTraversalMask
unsigned int getCastsShadowTraversalMask() const
Definition ShadowSettings:36
osgShadow::ShadowSettings::getPerspectiveShadowMapCutOffAngle
double getPerspectiveShadowMapCutOffAngle() const
Definition ShadowSettings:88
osgShadow::ShadowSettings::ShaderHint
ShaderHint
Definition ShadowSettings:105
osgShadow::ShadowSettings::NO_SHADERS
@ NO_SHADERS
Definition ShadowSettings:106
osgShadow::ShadowSettings::PROVIDE_FRAGMENT_SHADER
@ PROVIDE_FRAGMENT_SHADER
Definition ShadowSettings:107
osgShadow::ShadowSettings::PROVIDE_VERTEX_AND_FRAGMENT_SHADER
@ PROVIDE_VERTEX_AND_FRAGMENT_SHADER
Definition ShadowSettings:108
osgShadow::ShadowSettings::getDebugDraw
bool getDebugDraw() const
Definition ShadowSettings:115
osgShadow::ShadowSettings::getComputeNearFarModeOverride
osg::CullSettings::ComputeNearFarMode getComputeNearFarModeOverride() const
Definition ShadowSettings:39
osgShadow::ShadowSettings::_maximumShadowMapDistance
double _maximumShadowMapDistance
Definition ShadowSettings:133
osgShadow::ShadowSettings::_useShadowMapTextureOverride
bool _useShadowMapTextureOverride
Definition ShadowSettings:129
osgShadow::ShadowSettings::META_Object
META_Object(osgShadow, ShadowSettings)
osgShadow::ShadowSettings::getNumShadowMapsPerLight
unsigned int getNumShadowMapsPerLight() const
Definition ShadowSettings:92
osgShadow::ShadowSettings::getMultipleShadowMapHint
MultipleShadowMapHint getMultipleShadowMapHint() const
Definition ShadowSettings:101
osgShadow::ShadowSettings::setMaximumShadowMapDistance
void setMaximumShadowMapDistance(double distance)
Definition ShadowSettings:68
osgShadow::ShadowSettings::setMultipleShadowMapHint
void setMultipleShadowMapHint(MultipleShadowMapHint hint)
Definition ShadowSettings:100
osgShadow::ShadowSettings::setTextureSize
void setTextureSize(const osg::Vec2s &textureSize)
Definition ShadowSettings:60
osgShadow::ShadowSettings::getReceivesShadowTraversalMask
unsigned int getReceivesShadowTraversalMask() const
Definition ShadowSettings:33
osgShadow::ShadowSettings::setShaderHint
void setShaderHint(ShaderHint shaderHint)
Definition ShadowSettings:111
osgShadow::ShadowSettings::_numShadowMapsPerLight
unsigned int _numShadowMapsPerLight
Definition ShadowSettings:137
osgShadow::ShadowSettings::_lightNum
int _lightNum
Definition ShadowSettings:127
osgShadow::ShadowSettings::_receivesShadowTraversalMask
unsigned int _receivesShadowTraversalMask
Definition ShadowSettings:122
osgShadow::ShadowSettings::getUseOverrideForShadowMapTexture
bool getUseOverrideForShadowMapTexture() const
Definition ShadowSettings:56
osgShadow::ShadowSettings::setBaseShadowTextureUnit
void setBaseShadowTextureUnit(unsigned int unit)
Definition ShadowSettings:48
osgShadow::ShadowSettings::getMaximumShadowMapDistance
double getMaximumShadowMapDistance() const
Definition ShadowSettings:69
osgShadow::ShadowSettings::_multipleShadowMapHint
MultipleShadowMapHint _multipleShadowMapHint
Definition ShadowSettings:138
osgShadow::ShadowSettings::_baseShadowTextureUnit
unsigned int _baseShadowTextureUnit
Definition ShadowSettings:128
osgShadow::ShadowSettings::setComputeNearFarModeOverride
void setComputeNearFarModeOverride(osg::CullSettings::ComputeNearFarMode cnfn)
Definition ShadowSettings:38
osgShadow::ShadowSettings::setPerspectiveShadowMapCutOffAngle
void setPerspectiveShadowMapCutOffAngle(double angle)
Definition ShadowSettings:87
osgShadow::ShadowSettings::MultipleShadowMapHint
MultipleShadowMapHint
Definition ShadowSettings:95
osgShadow::ShadowSettings::CASCADED
@ CASCADED
Definition ShadowSettings:97
osgShadow::ShadowSettings::PARALLEL_SPLIT
@ PARALLEL_SPLIT
Definition ShadowSettings:96
osgShadow::ShadowSettings::_perspectiveShadowMapCutOffAngle
double _perspectiveShadowMapCutOffAngle
Definition ShadowSettings:135
osgShadow::ShadowSettings::_shaderHint
ShaderHint _shaderHint
Definition ShadowSettings:140
osgShadow::ShadowSettings::getLightNum
int getLightNum() const
Definition ShadowSettings:46
osgShadow::ShadowSettings::_castsShadowTraversalMask
unsigned int _castsShadowTraversalMask
Definition ShadowSettings:123
osgShadow::ShadowSettings::_textureSize
osg::Vec2s _textureSize
Definition ShadowSettings:130
osgShadow::ShadowSettings::setReceivesShadowTraversalMask
void setReceivesShadowTraversalMask(unsigned int mask)
Definition ShadowSettings:32
osgShadow::ShadowSettings::getBaseShadowTextureUnit
unsigned int getBaseShadowTextureUnit() const
Definition ShadowSettings:49
osgShadow::ShadowSettings::getMinimumShadowMapNearFarRatio
double getMinimumShadowMapNearFarRatio() const
Definition ShadowSettings:66
osgShadow::ShadowSettings::ShadowMapProjectionHint
ShadowMapProjectionHint
Definition ShadowSettings:73
osgShadow::ShadowSettings::ORTHOGRAPHIC_SHADOW_MAP
@ ORTHOGRAPHIC_SHADOW_MAP
Definition ShadowSettings:74
osgShadow::ShadowSettings::PERSPECTIVE_SHADOW_MAP
@ PERSPECTIVE_SHADOW_MAP
Definition ShadowSettings:75
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::CullSettings::ComputeNearFarMode
ComputeNearFarMode
Definition CullSettings:161
osg::Object
Definition Object:61
osg::Vec2s
Definition Vec2s:20
osgShadow
Definition ConvexPolyhedron:33
Export
OSGSHADOW_EXPORT
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39