OpenSceneGraph  3.4.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
osgShadow::ShadowSettings Class Reference

ShadowSettings provides the parameters that the ShadowTechnique should use as a guide for setting up shadowing. More...

Inheritance diagram for osgShadow::ShadowSettings:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ShadowMapProjectionHint { ORTHOGRAPHIC_SHADOW_MAP, PERSPECTIVE_SHADOW_MAP }
enum  MultipleShadowMapHint { PARALLEL_SPLIT, CASCADED }
enum  ShaderHint { NO_SHADERS, PROVIDE_FRAGMENT_SHADER, PROVIDE_VERTEX_AND_FRAGMENT_SHADER }

Public Member Functions

 ShadowSettings ()
 ShadowSettings (const ShadowSettings &ss, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Object (osgShadow, ShadowSettings)
void setReceivesShadowTraversalMask (unsigned int mask)
unsigned int getReceivesShadowTraversalMask () const
void setCastsShadowTraversalMask (unsigned int mask)
unsigned int getCastsShadowTraversalMask () const
void setComputeNearFarModeOverride (osg::CullSettings::ComputeNearFarMode cnfn)
osg::CullSettings::ComputeNearFarMode getComputeNearFarModeOverride () const
void setLightNum (int lightNum)
 Set the LightNum of the light in the scene to assign a shadow for.
int getLightNum () const
void setBaseShadowTextureUnit (unsigned int unit)
unsigned int getBaseShadowTextureUnit () const
void setUseOverrideForShadowMapTexture (bool useOverride)
 Set whether to use osg::StateAttribute::OVERRIDE for the shadow map texture.
bool getUseOverrideForShadowMapTexture () const
 Get whether to use osg::StateAttribute::OVERRIDE for the shadow map texture.
void setTextureSize (const osg::Vec2s &textureSize)
 Set the size of the shadow map textures.
const osg::Vec2sgetTextureSize () const
 Get the size of the shadow map textures.
void setMinimumShadowMapNearFarRatio (double ratio)
double getMinimumShadowMapNearFarRatio () const
void setMaximumShadowMapDistance (double distance)
double getMaximumShadowMapDistance () const
void setShadowMapProjectionHint (ShadowMapProjectionHint hint)
ShadowMapProjectionHint getShadowMapProjectionHint () const
void setPerspectiveShadowMapCutOffAngle (double angle)
 Set the cut off angle, in degrees, between the light direction and the view direction that determines whether perspective shadow mapping is appropriate, or thar orthographic shadow map should be used instead.
double getPerspectiveShadowMapCutOffAngle () const
void setNumShadowMapsPerLight (unsigned int numShadowMaps)
unsigned int getNumShadowMapsPerLight () const
void setMultipleShadowMapHint (MultipleShadowMapHint hint)
MultipleShadowMapHint getMultipleShadowMapHint () const
void setShaderHint (ShaderHint shaderHint)
ShaderHint getShaderHint () const
void setDebugDraw (bool debugDraw)
bool getDebugDraw () const

Protected Member Functions

virtual ~ShadowSettings ()

Protected Attributes

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

Detailed Description

ShadowSettings provides the parameters that the ShadowTechnique should use as a guide for setting up shadowing.


Member Enumeration Documentation

Enumerator:
PARALLEL_SPLIT 
CASCADED 
Enumerator:
NO_SHADERS 
PROVIDE_FRAGMENT_SHADER 
PROVIDE_VERTEX_AND_FRAGMENT_SHADER 
Enumerator:
ORTHOGRAPHIC_SHADOW_MAP 
PERSPECTIVE_SHADOW_MAP 

Constructor & Destructor Documentation

virtual osgShadow::ShadowSettings::~ShadowSettings ( ) [protected, virtual]

Member Function Documentation

unsigned int osgShadow::ShadowSettings::getBaseShadowTextureUnit ( ) const [inline]
bool osgShadow::ShadowSettings::getDebugDraw ( ) const [inline]
unsigned int osgShadow::ShadowSettings::getNumShadowMapsPerLight ( ) const [inline]

Get the size of the shadow map textures.

Get whether to use osg::StateAttribute::OVERRIDE for the shadow map texture.

void osgShadow::ShadowSettings::setBaseShadowTextureUnit ( unsigned int  unit) [inline]
void osgShadow::ShadowSettings::setCastsShadowTraversalMask ( unsigned int  mask) [inline]
void osgShadow::ShadowSettings::setDebugDraw ( bool  debugDraw) [inline]
void osgShadow::ShadowSettings::setLightNum ( int  lightNum) [inline]

Set the LightNum of the light in the scene to assign a shadow for.

Default value is -1, which signifies that shadow technique should automatically select an active light to assign a shadow, typically this will be the first active light found.

void osgShadow::ShadowSettings::setMaximumShadowMapDistance ( double  distance) [inline]
void osgShadow::ShadowSettings::setNumShadowMapsPerLight ( unsigned int  numShadowMaps) [inline]

Set the cut off angle, in degrees, between the light direction and the view direction that determines whether perspective shadow mapping is appropriate, or thar orthographic shadow map should be used instead.

Default is 2 degrees so that for any angle greater than 2 degrees perspective shadow map will be used, and any angle less than 2 degrees orthographic shadow map will be used. Note, if ShadowMapProjectionHint is set to ORTHOGRAPHIC_SHADOW_MAP then an orthographic shadow map will always be used.

void osgShadow::ShadowSettings::setReceivesShadowTraversalMask ( unsigned int  mask) [inline]
void osgShadow::ShadowSettings::setTextureSize ( const osg::Vec2s textureSize) [inline]

Set the size of the shadow map textures.

Set whether to use osg::StateAttribute::OVERRIDE for the shadow map texture.

Enabling override will force the shadow map texture to override any texture set on the shadow maps texture unit.


Member Data Documentation


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

osg logo
Generated at Tue Dec 8 2015 00:14:30 for the OpenSceneGraph by doxygen 1.7.6.1.