Show
Ignore:
Timestamp:
02/08/07 18:23:40 (7 years ago)
Author:
robert
Message:

Flesh out more of basic ShadowTechnique? and ShadowedScene? API.

Files:
1 modified

Legend:

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

    r6080 r6126  
    2424 
    2525#include <osgShadow/OccluderGeometry> 
     26#include <osgShadow/ShadowedScene> 
     27#include <osgShadow/ShadowVolume> 
    2628 
    2729#include <osgDB/ReadFile> 
     
    567569    while (arguments.read("--two-pass")) drawMode = osgShadow::ShadowVolumeGeometry::STENCIL_TWO_PASS; 
    568570     
     571    bool ShadowVolume = false; 
     572    while (arguments.read("--ShadowVolume")) ShadowVolume = true; 
     573 
    569574 
    570575    // set up the camera manipulators. 
     
    681686    light->setPosition(lightpos); 
    682687 
    683     if (!doShadow) 
     688    if (ShadowVolume) 
     689    { 
     690        osg::ref_ptr<osgShadow::ShadowedScene> shadowedScene = new osgShadow::ShadowedScene; 
     691         
     692        shadowedScene->setShadowTechnique(new osgShadow::ShadowVolume); 
     693 
     694        shadowedScene->addChild(model.get()); 
     695         
     696        group->addChild(shadowedScene.get()); 
     697    } 
     698    else if (!doShadow) 
    684699    { 
    685700        group->addChild(model.get());