osgShadow::SoftShadowMap Class Reference

SoftShadowMap provides an implementation of soft shadows with shadow maps. More...

Inheritance diagram for osgShadow::SoftShadowMap:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 SoftShadowMap ()
 SoftShadowMap (const SoftShadowMap &es, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
 META_Object (osgShadow, SoftShadowMap)
void setTextureUnit (unsigned int unit)
 Set the texture unit that the shadow texture will be applied on.
unsigned int getTextureUnit () const
 Get the texture unit that the shadow texture will be applied on.
void setAmbientBias (const osg::Vec2 &ambientBias)
 Set the values for the ambient bias the shader will use.
void setTextureSize (int width, int height)
 Set the resolution of the rendertarget texture used for shadow generation.
void setTextureSize (const osg::Vec2s &)
 Set the resolution of the rendertarget texture used for shadow generation.
const osg::Vec2sgetTextureSize () const
 Get the resolution of the rendertarget texture used for shadow generation.
void setBias (float bias)
 Add a small bias to the z-value when calculating the MVPT matrix, this can reduce shadow acne problem.
float getBias () const
 Return the bias value set used when calculating the MVPT matrix.
void setSoftnessWidth (const float softnesswidth)
 Set the values for width of the soft penumbra the shader will use.
void setJitteringScale (const float jitteringscale)
 Set the values for jittering scale the shader will use.
const osg::Vec2getAmbientBias () const
 Get the values that are used for the ambient bias in the shader.
const float getSoftnessWidth () const
 Get the value used for width of the soft penumbra in the shader.
const float getJitteringScale () const
 Get the value used for jittering scale in the shader.
virtual void init ()
 initialize the ShadowedScene and local cached data structures.
virtual void update (osg::NodeVisitor &nv)
 run the update traversal of the ShadowedScene and update any loca chached data structures.
virtual void cull (osgUtil::CullVisitor &cv)
 run the cull traversal of the ShadowedScene and set up the rendering for this ShadowTechnique.
virtual void cleanSceneGraph ()
 Clean scene graph from any shadow technique specific nodes, state and drawables.

Protected Member Functions

virtual ~SoftShadowMap ()
void initJittering (osg::StateSet *)

Protected Attributes

osg::ref_ptr
< osg::Camera
_camera
osg::ref_ptr
< osg::TexGen
_texgen
osg::ref_ptr
< osg::Texture2D
_texture
osg::ref_ptr
< osg::StateSet
_stateset
unsigned int _textureUnit
osg::Vec2 _ambientBias
float _softnesswidth
float _jitteringscale
float _bias
osg::Vec2s _textureSize


Detailed Description

SoftShadowMap provides an implementation of soft shadows with shadow maps.


Constructor & Destructor Documentation

osgShadow::SoftShadowMap::SoftShadowMap (  ) 

osgShadow::SoftShadowMap::SoftShadowMap ( const SoftShadowMap es,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)

virtual osgShadow::SoftShadowMap::~SoftShadowMap (  )  [inline, protected, virtual]


Member Function Documentation

osgShadow::SoftShadowMap::META_Object ( osgShadow  ,
SoftShadowMap   
)

void osgShadow::SoftShadowMap::setTextureUnit ( unsigned int  unit  ) 

Set the texture unit that the shadow texture will be applied on.

unsigned int osgShadow::SoftShadowMap::getTextureUnit (  )  const [inline]

Get the texture unit that the shadow texture will be applied on.

void osgShadow::SoftShadowMap::setAmbientBias ( const osg::Vec2 ambientBias  ) 

Set the values for the ambient bias the shader will use.

void osgShadow::SoftShadowMap::setTextureSize ( int  width,
int  height 
) [inline]

Set the resolution of the rendertarget texture used for shadow generation.

void osgShadow::SoftShadowMap::setTextureSize ( const osg::Vec2s  ) 

Set the resolution of the rendertarget texture used for shadow generation.

const osg::Vec2s& osgShadow::SoftShadowMap::getTextureSize (  )  const [inline]

Get the resolution of the rendertarget texture used for shadow generation.

void osgShadow::SoftShadowMap::setBias ( float  bias  )  [inline]

Add a small bias to the z-value when calculating the MVPT matrix, this can reduce shadow acne problem.

Suitable values are 0-0.005 Default is 0.

float osgShadow::SoftShadowMap::getBias (  )  const [inline]

Return the bias value set used when calculating the MVPT matrix.

void osgShadow::SoftShadowMap::setSoftnessWidth ( const float  softnesswidth  ) 

Set the values for width of the soft penumbra the shader will use.

Zero is for hard shadow (no penumbra). 0.01 is already very soft penumbra. Default is 0.005.

void osgShadow::SoftShadowMap::setJitteringScale ( const float  jitteringscale  ) 

Set the values for jittering scale the shader will use.

Zero is no jittering (i.e. see the banding in penumbra) High values (>64) cause 'pixelization' of the penumbra. Usually but not necessarily power of two number. Default is 32.

const osg::Vec2& osgShadow::SoftShadowMap::getAmbientBias (  )  const [inline]

Get the values that are used for the ambient bias in the shader.

const float osgShadow::SoftShadowMap::getSoftnessWidth (  )  const [inline]

Get the value used for width of the soft penumbra in the shader.

const float osgShadow::SoftShadowMap::getJitteringScale (  )  const [inline]

Get the value used for jittering scale in the shader.

virtual void osgShadow::SoftShadowMap::init (  )  [virtual]

initialize the ShadowedScene and local cached data structures.

Reimplemented from osgShadow::ShadowTechnique.

virtual void osgShadow::SoftShadowMap::update ( osg::NodeVisitor nv  )  [virtual]

run the update traversal of the ShadowedScene and update any loca chached data structures.

Reimplemented from osgShadow::ShadowTechnique.

virtual void osgShadow::SoftShadowMap::cull ( osgUtil::CullVisitor cv  )  [virtual]

run the cull traversal of the ShadowedScene and set up the rendering for this ShadowTechnique.

Reimplemented from osgShadow::ShadowTechnique.

virtual void osgShadow::SoftShadowMap::cleanSceneGraph (  )  [virtual]

Clean scene graph from any shadow technique specific nodes, state and drawables.

Reimplemented from osgShadow::ShadowTechnique.

void osgShadow::SoftShadowMap::initJittering ( osg::StateSet  )  [protected]


Member Data Documentation

osg::ref_ptr<osg::Camera> osgShadow::SoftShadowMap::_camera [protected]

osg::ref_ptr<osg::TexGen> osgShadow::SoftShadowMap::_texgen [protected]

osg::ref_ptr<osg::Texture2D> osgShadow::SoftShadowMap::_texture [protected]

osg::ref_ptr<osg::StateSet> osgShadow::SoftShadowMap::_stateset [protected]

unsigned int osgShadow::SoftShadowMap::_textureUnit [protected]

osg::Vec2 osgShadow::SoftShadowMap::_ambientBias [protected]

float osgShadow::SoftShadowMap::_softnesswidth [protected]

float osgShadow::SoftShadowMap::_jitteringscale [protected]

float osgShadow::SoftShadowMap::_bias [protected]

osg::Vec2s osgShadow::SoftShadowMap::_textureSize [protected]


The documentation for this class was generated from the following file:
Generated at Sun Oct 14 02:12:45 2007 for the OpenSceneGraph by doxygen 1.5.3.