Show
Ignore:
Timestamp:
09/19/07 13:56:44 (7 years ago)
Author:
robert
Message:

From Adrian Egli, ParallelSplitShadowMap? implmentation.

Changes by Robert Osfield - CMakeLists.txt and name change to ParallelSplitShadowMap?.

Files:
1 modified

Legend:

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

    r7219 r7441  
    4141#include <osgShadow/ShadowMap> 
    4242#include <osgShadow/SoftShadowMap> 
     43#include <osgShadow/ParallelSplitShadowMap> 
    4344 
    4445#include <osgDB/ReadFile> 
     
    495496    arguments.getApplicationUsage()->addCommandLineOption("--sm", "Select ShadowMap implementation."); 
    496497//    arguments.getApplicationUsage()->addCommandLineOption("--pssm", "Select ParallelSplitShadowMap implementation."); 
     498    arguments.getApplicationUsage()->addCommandLineOption("--pssm", "Select ParallelSplitShadowMap implementation.");//ADEGLI 
     499    arguments.getApplicationUsage()->addCommandLineOption("--mapcount", "ParallelSplitShadowMap texture count.");//ADEGLI 
     500 
    497501    arguments.getApplicationUsage()->addCommandLineOption("-1", "Use test model one."); 
    498502    arguments.getApplicationUsage()->addCommandLineOption("-2", "Use test model two."); 
     
    614618        shadowedScene->setShadowTechnique(st.get()); 
    615619    } 
    616 #if 0     
    617620    else if (arguments.read("--pssm")) 
    618621    { 
    619         osg::ref_ptr<osgShadow::ParallelSplitShadowMap> pssm = new osgShadow::ParallelSplitShadowMap; 
     622        int mapcount = 3; 
     623        while (arguments.read("--mapcount", mapcount)); 
     624        osg::ref_ptr<osgShadow::ParallelSplitShadowMap> pssm = new osgShadow::ParallelSplitShadowMap(NULL,mapcount); 
    620625        shadowedScene->setShadowTechnique(pssm.get()); 
    621626    } 
    622 #endif     
    623627    else if (arguments.read("--ssm")) 
    624628    { 
     
    688692            } 
    689693            ls->getLight()->setPosition(lightpos); 
     694             
     695            osg::Vec3f lightDir(-lightpos.x(),-lightpos.y(),-lightpos.z()); 
     696            lightDir.normalize(); 
     697            ls->getLight()->setDirection(lightDir); 
    690698        } 
    691699