Skip to content

Commit

Permalink
Fix the GPU Clamping so it works with log depth buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Feb 7, 2015
1 parent 87a9fff commit 50a59a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/osgEarth/ClampingTechnique.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,12 @@ ClampingTechnique::setUpCamera(OverlayDecorator::TechRTTParams& params)
rttStateSet->setAttributeAndModes(
new osg::PolygonMode( osg::PolygonMode::FRONT_AND_BACK, osg::PolygonMode::FILL ),
osg::StateAttribute::ON | osg::StateAttribute::PROTECTED );

// install a VP on the stateset that cancels out any higher-up VP code.
// This will prevent things like VPs on the main camera (e.g., log depth buffer)
// from interfering with the depth camera
VirtualProgram* rttVP = VirtualProgram::getOrCreate(rttStateSet);
rttVP->setInheritShaders(false);

// attach the terrain to the camera.
// todo: should probably protect this with a mutex.....
Expand Down

0 comments on commit 50a59a6

Please sign in to comment.