Show
Ignore:
Timestamp:
08/12/11 22:29:14 (3 years ago)
Author:
robert
Message:

Added public interface for selecting use of perspective and light space perspective shadow maps. Implementation
of backends not implemented yet so will follow.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgshadow/osgshadow.cpp

    r12748 r12750  
    794794        shadowedScene->setShadowTechnique(sm.get()); 
    795795    } 
     796    else if( arguments.read("--vdsm") ) 
     797    { 
     798        osg::ref_ptr<osgShadow::ViewDependentShadowMap> vdsm = new osgShadow::ViewDependentShadowMap; 
     799        while( arguments.read("--debugHUD") ) vdsm->setDebugDraw( true ); 
     800 
     801        if (arguments.read("--persp")) vdsm->setShadowMapProjectionHint(osgShadow::ViewDependentShadowMap::PERSPECTIVE_SHADOW_MAP); 
     802        if (arguments.read("--lispsm")) vdsm->setShadowMapProjectionHint(osgShadow::ViewDependentShadowMap::LIGHT_SPACE_PERSPECTIVE_SHADOW_MAP); 
     803         
     804        shadowedScene->setShadowTechnique(vdsm.get()); 
     805    } 
    796806    else if ( arguments.read("--lispsm") )  
    797807    { 
     
    811821       else // if( arguments.read( "--DrawBounds" ) ) // default 
    812822            msm = new osgShadow::MinimalDrawBoundsShadowMap; 
    813     } 
    814     else if( arguments.read("--vdsm") ) 
    815     { 
    816         osg::ref_ptr<osgShadow::ViewDependentShadowMap> vdsm = new osgShadow::ViewDependentShadowMap; 
    817         while( arguments.read("--debugHUD") ) vdsm->setDebugDraw( true ); 
    818         shadowedScene->setShadowTechnique(vdsm.get()); 
    819823    } 
    820824    else /* if (arguments.read("--sm")) */