Added public interface for selecting use of perspective and light space perspective shadow maps. Implementation

of backends not implemented yet so will follow.
This commit is contained in:
Robert Osfield
2011-08-12 20:29:14 +00:00
parent 6b7175baac
commit b15317481c
3 changed files with 77 additions and 33 deletions

View File

@@ -793,6 +793,16 @@ int main(int argc, char** argv)
osg::ref_ptr<osgShadow::SoftShadowMap> sm = new osgShadow::SoftShadowMap;
shadowedScene->setShadowTechnique(sm.get());
}
else if( arguments.read("--vdsm") )
{
osg::ref_ptr<osgShadow::ViewDependentShadowMap> vdsm = new osgShadow::ViewDependentShadowMap;
while( arguments.read("--debugHUD") ) vdsm->setDebugDraw( true );
if (arguments.read("--persp")) vdsm->setShadowMapProjectionHint(osgShadow::ViewDependentShadowMap::PERSPECTIVE_SHADOW_MAP);
if (arguments.read("--lispsm")) vdsm->setShadowMapProjectionHint(osgShadow::ViewDependentShadowMap::LIGHT_SPACE_PERSPECTIVE_SHADOW_MAP);
shadowedScene->setShadowTechnique(vdsm.get());
}
else if ( arguments.read("--lispsm") )
{
if( arguments.read( "--ViewBounds" ) )
@@ -811,12 +821,6 @@ int main(int argc, char** argv)
else // if( arguments.read( "--DrawBounds" ) ) // default
msm = new osgShadow::MinimalDrawBoundsShadowMap;
}
else if( arguments.read("--vdsm") )
{
osg::ref_ptr<osgShadow::ViewDependentShadowMap> vdsm = new osgShadow::ViewDependentShadowMap;
while( arguments.read("--debugHUD") ) vdsm->setDebugDraw( true );
shadowedScene->setShadowTechnique(vdsm.get());
}
else /* if (arguments.read("--sm")) */
{
osg::ref_ptr<osgShadow::ShadowMap> sm = new osgShadow::ShadowMap;