Show
Ignore:
Timestamp:
05/28/08 16:11:22 (7 years ago)
Author:
robert
Message:

From Adrian Egli, improvements to ParallelSplitShadowMap? implementation

Files:
1 modified

Legend:

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

    r7990 r8379  
    503503    arguments.getApplicationUsage()->addCommandLineOption("--maxFarDist", "ParallelSplitShadowMap max far distance to shadow.");//ADEGLI 
    504504    arguments.getApplicationUsage()->addCommandLineOption("--moveVCamFactor", "ParallelSplitShadowMap move the virtual frustum behind the real camera, (also back ground object can cast shadow).");//ADEGLI 
    505     arguments.getApplicationUsage()->addCommandLineOption("--NVidia", "ParallelSplitShadowMap set default PolygonOffset for NVidia.");//ADEGLI 
    506505    arguments.getApplicationUsage()->addCommandLineOption("--PolyOffset-Factor", "ParallelSplitShadowMap set PolygonOffset factor.");//ADEGLI 
    507506    arguments.getApplicationUsage()->addCommandLineOption("--PolyOffset-Unit", "ParallelSplitShadowMap set PolygonOffset unit.");//ADEGLI 
    508     arguments.getApplicationUsage()->addCommandLineOption("--CullFaceFront", "ParallelSplitShadowMap add a cull face: front.");//ADEGLI 
    509507 
    510508 
     
    627625 
    628626 
    629         double polyoffsetfactor = -0.02; 
    630         double polyoffsetunit = 1.0; 
     627         
     628        double polyoffsetfactor = pssm->getPolygonOffset().x(); 
     629        double polyoffsetunit   = pssm->getPolygonOffset().y(); 
    631630        while (arguments.read("--PolyOffset-Factor", polyoffsetfactor)); 
    632631        while (arguments.read("--PolyOffset-Unit", polyoffsetunit)); 
    633         pssm->setPolygonOffset(osg::Vec2(polyoffsetfactor,polyoffsetunit)); //ATI Radeon 
    634  
    635         if (arguments.read("--NVidia")){ 
    636             //pssm->setPolygonOffset(osg::Vec2(-0.02,1.0)); //ATI Radeon 
    637             pssm->setPolygonOffset(osg::Vec2(10.0f,20.0f)); //NVidia 
    638         } 
    639  
    640         if ( arguments.read("--CullFaceFront") ) { 
    641             pssm->forceFrontCullFace(); 
    642         } 
     632        pssm->setPolygonOffset(osg::Vec2(polyoffsetfactor,polyoffsetunit));  
    643633 
    644634        shadowedScene->setShadowTechnique(pssm.get()); 
     
    762752 
    763753    // osgDB::writeNodeFile(*group,"test.osg"); 
    764  
     754  
    765755    while (!viewer.done()) 
    766756    {