OpenSceneGraph
3.4.0
|
SoftShadowMap provides an implementation of soft shadows with shadow maps. More...
Public Member Functions | |
SoftShadowMap () | |
SoftShadowMap (const SoftShadowMap &es, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY) | |
META_Object (osgShadow, SoftShadowMap) | |
void | setSoftnessWidth (float softnessWidth) |
Set the values for width of the soft penumbra the shader will use. | |
float | getSoftnessWidth () const |
Get the value used for width of the soft penumbra in the shader. | |
void | setJitteringScale (float jitteringScale) |
Set the values for jittering scale the shader will use. | |
float | getJitteringScale () const |
Get the value used for jittering scale in the shader. | |
void | setJitterTextureUnit (unsigned int jitterTextureUnit) |
Set the texture unit that the jitter texture will be applied on. | |
unsigned int | getJitterTextureUnit () const |
Get the texture unit that the jitter texture will be applied on. | |
void | setBias (float bias) |
Add a small bias to the z-value, this can reduce shadow acne problem. | |
float | getBias () const |
Return the bias value. | |
Protected Member Functions | |
virtual | ~SoftShadowMap (void) |
void | createUniforms () |
Create the managed Uniforms. | |
void | createShaders () |
void | initJittering (osg::StateSet *ss) |
Protected Attributes | |
osg::ref_ptr< osg::Uniform > | _softnessWidthUniform |
osg::ref_ptr< osg::Uniform > | _jitteringScaleUniform |
float | _softnessWidth |
float | _jitteringScale |
unsigned int | _jitterTextureUnit |
SoftShadowMap provides an implementation of soft shadows with shadow maps.
osgShadow::SoftShadowMap::SoftShadowMap | ( | const SoftShadowMap & | es, |
const osg::CopyOp & | copyop = osg::CopyOp::SHALLOW_COPY |
||
) |
virtual osgShadow::SoftShadowMap::~SoftShadowMap | ( | void | ) | [inline, protected, virtual] |
void osgShadow::SoftShadowMap::createShaders | ( | ) | [protected, virtual] |
Reimplemented from osgShadow::ShadowMap.
void osgShadow::SoftShadowMap::createUniforms | ( | ) | [protected, virtual] |
Create the managed Uniforms.
Reimplemented from osgShadow::ShadowMap.
float osgShadow::SoftShadowMap::getBias | ( | ) | const [inline] |
Return the bias value.
float osgShadow::SoftShadowMap::getJitteringScale | ( | ) | const [inline] |
Get the value used for jittering scale in the shader.
unsigned int osgShadow::SoftShadowMap::getJitterTextureUnit | ( | ) | const [inline] |
Get the texture unit that the jitter texture will be applied on.
float osgShadow::SoftShadowMap::getSoftnessWidth | ( | ) | const [inline] |
Get the value used for width of the soft penumbra in the shader.
void osgShadow::SoftShadowMap::initJittering | ( | osg::StateSet * | ss | ) | [protected] |
osgShadow::SoftShadowMap::META_Object | ( | osgShadow | , |
SoftShadowMap | |||
) |
void osgShadow::SoftShadowMap::setBias | ( | float | bias | ) | [inline] |
Add a small bias to the z-value, this can reduce shadow acne problem.
This is the same as calling setPolygonOffset(osg::Vec2(bias,0)); Suitable values are 0-0.005 Default is 0.
void osgShadow::SoftShadowMap::setJitteringScale | ( | 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.
void osgShadow::SoftShadowMap::setJitterTextureUnit | ( | unsigned int | jitterTextureUnit | ) |
Set the texture unit that the jitter texture will be applied on.
void osgShadow::SoftShadowMap::setSoftnessWidth | ( | 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.
float osgShadow::SoftShadowMap::_jitteringScale [protected] |
unsigned int osgShadow::SoftShadowMap::_jitterTextureUnit [protected] |
float osgShadow::SoftShadowMap::_softnessWidth [protected] |
![]() | Generated at Tue Dec 8 2015 00:16:49 for the OpenSceneGraph by doxygen 1.7.6.1. |