Show
Ignore:
Timestamp:
03/01/11 16:04:56 (4 years ago)
Author:
robert
Message:

Added support for passing the --depth-partition distance, throw to the depth partition slave camera setup.

Files:
1 modified

Legend:

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

    r12196 r12197  
    604604void setUpViewForDepthPartion(osgViewer::Viewer& viewer, double partitionPosition) 
    605605{ 
    606     OSG_NOTICE<<"setUpViewForDepthPartion(Viewer, "<<partitionPosition<<std::endl; 
     606    OSG_NOTICE<<"setUpViewForDepthPartion(Viewer, "<<partitionPosition<<")std::endl; 
    607607 
    608608    osg::GraphicsContext::WindowingSystemInterface* wsi = osg::GraphicsContext::getWindowingSystemInterface(); 
     
    645645    } 
    646646 
    647 #if 0 
    648  
    649     osg::Camera* camera = viewer.getCamera(); 
    650  
    651     camera->setGraphicsContext(gc); 
    652     camera->setViewport(new osg::Viewport(0,0, width, height)); 
    653     GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; 
    654     camera->setDrawBuffer(buffer); 
    655     camera->setReadBuffer(buffer); 
    656  
    657 #else 
    658  
    659647    double zNear = 0.5; 
    660     double zMid = 10.0; 
     648    double zMid = partitionPosition; 
    661649    double zFar = 200.0; 
    662  
    663650 
    664651    // far camera 
     
    706693        slave._updateSlaveCallback =  new MyUpdateSlaveCallback(zNear, zMid); 
    707694    } 
    708  
    709  
    710 #endif 
    711  
    712695} 
    713696 
     
    771754    } 
    772755 
    773     double partitionPosition = 0.1; 
     756    double partitionPosition = 5.0; 
    774757    if (arguments.read("--depth-partition",partitionPosition) || arguments.read("--dp")) 
    775758    {