OSG  3.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
osgShadow::ShadowSettings Class Reference

#include <ShadowSettings.h>

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

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 Types inherited from osg::Object
enum  DataVariance { DYNAMIC, STATIC, UNSPECIFIED }
 

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)
 
int getLightNum () const
 
void setBaseShadowTextureUnit (unsigned int unit)
 
unsigned int getBaseShadowTextureUnit () const
 
void setUseOverrideForShadowMapTexture (bool useOverride)
 
bool getUseOverrideForShadowMapTexture () const
 
void setTextureSize (const osg::Vec2s &textureSize)
 
const osg::Vec2sgetTextureSize () const
 
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)
 
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
 
- Public Member Functions inherited from osg::Object
 Object ()
 
 Object (bool threadSafeRefUnref)
 
 Object (const Object &, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
 
virtual ObjectcloneType () const =0
 
virtual Objectclone (const CopyOp &) const =0
 
virtual bool isSameKindAs (const Object *) const
 
virtual const char * libraryName () const =0
 
virtual const char * className () const =0
 
std::string getCompoundClassName () const
 
virtual NodeasNode ()
 
virtual const NodeasNode () const
 
virtual NodeVisitorasNodeVisitor ()
 
virtual const NodeVisitorasNodeVisitor () const
 
virtual StateAttributeasStateAttribute ()
 
virtual const StateAttributeasStateAttribute () const
 
virtual UniformasUniform ()
 
virtual const UniformasUniform () const
 
virtual void setThreadSafeRefUnref (bool threadSafe)
 
virtual void setName (const std::string &name)
 
void setName (const char *name)
 
const std::string & getName () const
 
void setDataVariance (DataVariance dv)
 
DataVariance getDataVariance () const
 
virtual void computeDataVariance ()
 
void setUserDataContainer (osg::UserDataContainer *udc)
 
osg::UserDataContainergetUserDataContainer ()
 
const osg::UserDataContainergetUserDataContainer () const
 
osg::UserDataContainergetOrCreateUserDataContainer ()
 
virtual void setUserData (Referenced *obj)
 
virtual ReferencedgetUserData ()
 
virtual const ReferencedgetUserData () const
 
template<typename T >
bool getUserValue (const std::string &name, T &value) const
 
template<typename T >
void setUserValue (const std::string &name, const T &value)
 
virtual void resizeGLObjectBuffers (unsigned int)
 
virtual void releaseGLObjects (osg::State *=0) const
 
template<typename T >
BoolValueObject
UCharValueObject
UShortValueObject
UIntValueObject
DoubleValueObject
Vec3fValueObject
Vec2dValueObject
Vec4dValueObject
PlaneValueObject
MatrixdValueObject
BoundingBoxdValueObject
BoundingSpheredValueObject
bool 
getUserValue (const std::string &name, T &value) const
 
- Public Member Functions inherited from osg::Referenced
 Referenced ()
 
 Referenced (bool threadSafeRefUnref)
 
 Referenced (const Referenced &)
 
Referencedoperator= (const Referenced &)
 
bool getThreadSafeRefUnref () const
 
OpenThreads::MutexgetRefMutex () const
 
int ref () const
 
int unref () const
 
int unref_nodelete () const
 
int referenceCount () const
 
ObserverSetgetObserverSet () const
 
ObserverSetgetOrCreateObserverSet () const
 
void addObserver (Observer *observer) const
 
void removeObserver (Observer *observer) const
 

Protected Member Functions

virtual ~ShadowSettings ()
 
- Protected Member Functions inherited from osg::Object
virtual ~Object ()
 
- Protected Member Functions inherited from osg::Referenced
virtual ~Referenced ()
 
void signalObserversAndDelete (bool signalDelete, bool doDelete) const
 
void deleteUsingDeleteHandler () const
 

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
 
- Protected Attributes inherited from osg::Object
std::string _name
 
DataVariance _dataVariance
 
osg::UserDataContainer_userDataContainer
 
- Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr _observerSet
 
OpenThreads::Atomic _refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from osg::Referenced
static OpenThreads::MutexgetGlobalReferencedMutex ()
 
static void setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting)
 
static bool getThreadSafeReferenceCounting ()
 
static void setDeleteHandler (DeleteHandler *handler)
 
static DeleteHandlergetDeleteHandler ()
 

Detailed Description

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

Definition at line 24 of file ShadowSettings.h.

Member Enumeration Documentation

Enumerator
PARALLEL_SPLIT 
CASCADED 

Definition at line 94 of file ShadowSettings.h.

Enumerator
NO_SHADERS 
PROVIDE_FRAGMENT_SHADER 
PROVIDE_VERTEX_AND_FRAGMENT_SHADER 

Definition at line 104 of file ShadowSettings.h.

Enumerator
ORTHOGRAPHIC_SHADOW_MAP 
PERSPECTIVE_SHADOW_MAP 

Definition at line 72 of file ShadowSettings.h.

Constructor & Destructor Documentation

osgShadow::ShadowSettings::ShadowSettings ( )
osgShadow::ShadowSettings::ShadowSettings ( const ShadowSettings ss,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)
virtual osgShadow::ShadowSettings::~ShadowSettings ( )
protectedvirtual

Member Function Documentation

unsigned int osgShadow::ShadowSettings::getBaseShadowTextureUnit ( ) const
inline

Definition at line 49 of file ShadowSettings.h.

unsigned int osgShadow::ShadowSettings::getCastsShadowTraversalMask ( ) const
inline

Definition at line 36 of file ShadowSettings.h.

osg::CullSettings::ComputeNearFarMode osgShadow::ShadowSettings::getComputeNearFarModeOverride ( ) const
inline

Definition at line 39 of file ShadowSettings.h.

bool osgShadow::ShadowSettings::getDebugDraw ( ) const
inline

Definition at line 115 of file ShadowSettings.h.

int osgShadow::ShadowSettings::getLightNum ( ) const
inline

Definition at line 46 of file ShadowSettings.h.

double osgShadow::ShadowSettings::getMaximumShadowMapDistance ( ) const
inline

Definition at line 69 of file ShadowSettings.h.

double osgShadow::ShadowSettings::getMinimumShadowMapNearFarRatio ( ) const
inline

Definition at line 66 of file ShadowSettings.h.

MultipleShadowMapHint osgShadow::ShadowSettings::getMultipleShadowMapHint ( ) const
inline

Definition at line 101 of file ShadowSettings.h.

unsigned int osgShadow::ShadowSettings::getNumShadowMapsPerLight ( ) const
inline

Definition at line 92 of file ShadowSettings.h.

double osgShadow::ShadowSettings::getPerspectiveShadowMapCutOffAngle ( ) const
inline

Definition at line 88 of file ShadowSettings.h.

unsigned int osgShadow::ShadowSettings::getReceivesShadowTraversalMask ( ) const
inline

Definition at line 33 of file ShadowSettings.h.

ShaderHint osgShadow::ShadowSettings::getShaderHint ( ) const
inline

Definition at line 112 of file ShadowSettings.h.

ShadowMapProjectionHint osgShadow::ShadowSettings::getShadowMapProjectionHint ( ) const
inline

Definition at line 79 of file ShadowSettings.h.

const osg::Vec2s& osgShadow::ShadowSettings::getTextureSize ( ) const
inline

Get the size of the shadow map textures.

Definition at line 63 of file ShadowSettings.h.

bool osgShadow::ShadowSettings::getUseOverrideForShadowMapTexture ( ) const
inline

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

Definition at line 56 of file ShadowSettings.h.

osgShadow::ShadowSettings::META_Object ( osgShadow  ,
ShadowSettings   
)
void osgShadow::ShadowSettings::setBaseShadowTextureUnit ( unsigned int  unit)
inline

Definition at line 48 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setCastsShadowTraversalMask ( unsigned int  mask)
inline

Definition at line 35 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setComputeNearFarModeOverride ( osg::CullSettings::ComputeNearFarMode  cnfn)
inline

Definition at line 38 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setDebugDraw ( bool  debugDraw)
inline

Definition at line 114 of file ShadowSettings.h.

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.

Definition at line 45 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setMaximumShadowMapDistance ( double  distance)
inline

Definition at line 68 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setMinimumShadowMapNearFarRatio ( double  ratio)
inline

Definition at line 65 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setMultipleShadowMapHint ( MultipleShadowMapHint  hint)
inline

Definition at line 100 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setNumShadowMapsPerLight ( unsigned int  numShadowMaps)
inline

Definition at line 91 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setPerspectiveShadowMapCutOffAngle ( double  angle)
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.

Definition at line 87 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setReceivesShadowTraversalMask ( unsigned int  mask)
inline

Definition at line 32 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setShaderHint ( ShaderHint  shaderHint)
inline

Definition at line 111 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setShadowMapProjectionHint ( ShadowMapProjectionHint  hint)
inline

Definition at line 78 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setTextureSize ( const osg::Vec2s textureSize)
inline

Set the size of the shadow map textures.

Definition at line 60 of file ShadowSettings.h.

void osgShadow::ShadowSettings::setUseOverrideForShadowMapTexture ( bool  useOverride)
inline

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.

Definition at line 53 of file ShadowSettings.h.

Member Data Documentation

unsigned int osgShadow::ShadowSettings::_baseShadowTextureUnit
protected

Definition at line 128 of file ShadowSettings.h.

unsigned int osgShadow::ShadowSettings::_castsShadowTraversalMask
protected

Definition at line 123 of file ShadowSettings.h.

osg::CullSettings::ComputeNearFarMode osgShadow::ShadowSettings::_computeNearFearModeOverride
protected

Definition at line 125 of file ShadowSettings.h.

bool osgShadow::ShadowSettings::_debugDraw
protected

Definition at line 141 of file ShadowSettings.h.

int osgShadow::ShadowSettings::_lightNum
protected

Definition at line 127 of file ShadowSettings.h.

double osgShadow::ShadowSettings::_maximumShadowMapDistance
protected

Definition at line 133 of file ShadowSettings.h.

double osgShadow::ShadowSettings::_minimumShadowMapNearFarRatio
protected

Definition at line 132 of file ShadowSettings.h.

MultipleShadowMapHint osgShadow::ShadowSettings::_multipleShadowMapHint
protected

Definition at line 138 of file ShadowSettings.h.

unsigned int osgShadow::ShadowSettings::_numShadowMapsPerLight
protected

Definition at line 137 of file ShadowSettings.h.

double osgShadow::ShadowSettings::_perspectiveShadowMapCutOffAngle
protected

Definition at line 135 of file ShadowSettings.h.

unsigned int osgShadow::ShadowSettings::_receivesShadowTraversalMask
protected

Definition at line 122 of file ShadowSettings.h.

ShaderHint osgShadow::ShadowSettings::_shaderHint
protected

Definition at line 140 of file ShadowSettings.h.

ShadowMapProjectionHint osgShadow::ShadowSettings::_shadowMapProjectionHint
protected

Definition at line 134 of file ShadowSettings.h.

osg::Vec2s osgShadow::ShadowSettings::_textureSize
protected

Definition at line 130 of file ShadowSettings.h.

bool osgShadow::ShadowSettings::_useShadowMapTextureOverride
protected

Definition at line 129 of file ShadowSettings.h.


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