osgShadow::SoftShadowMap Class Reference

Inheritance diagram for osgShadow::SoftShadowMap:

osgShadow::ShadowTechnique osg::Object osg::Referenced

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)
unsigned int getTextureUnit () const
void setAmbientBias (const osg::Vec2 &ambientBias)
void setTextureSize (int width, int height)
void setTextureSize (const osg::Vec2s &)
const osg::Vec2sgetTextureSize () const
void setBias (float bias)
float getBias () const
void setSoftnessWidth (const float softnesswidth)
void setJitteringScale (const float jitteringscale)
const osg::Vec2getAmbientBias () const
const float getSoftnessWidth () const
const float getJitteringScale () const
virtual void init ()
virtual void update (osg::NodeVisitor &nv)
virtual void cull (osgUtil::CullVisitor &cv)
virtual void cleanSceneGraph ()

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

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


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

Generated on Wed Aug 13 17:03:41 2008 for openscenegraph by  doxygen 1.5.6