Added RenderStage::setClear*() methods from Camera::getClear*() sources

This commit is contained in:
Robert Osfield
2008-05-24 09:24:37 +00:00
parent cc07d064bf
commit 9623731185

View File

@@ -1294,19 +1294,23 @@ void CullVisitor::apply(osg::Camera& camera)
// reusing render to texture stage, so need to reset it to empty it from previous frames contents.
rtts->reset();
}
// set up clera masks/values
rtts->setClearDepth(camera.getClearDepth());
rtts->setClearAccum(camera.getClearAccum());
rtts->setClearStencil(camera.getClearStencil());
rtts->setClearMask(camera.getClearMask());
// set up the background color and clear mask.
if (camera.getInheritanceMask() & CLEAR_COLOR)
{
rtts->setClearColor(camera.getClearColor());
rtts->setClearColor(previous_stage->getClearColor());
}
else
{
rtts->setClearColor(previous_stage->getClearColor());
rtts->setClearColor(camera.getClearColor());
}
rtts->setClearMask(camera.getClearMask());
// set the color mask.
osg::ColorMask* colorMask = camera.getColorMask()!=0 ? camera.getColorMask() : previous_stage->getColorMask();
@@ -1317,6 +1321,7 @@ void CullVisitor::apply(osg::Camera& camera)
rtts->setViewport( viewport );
// set up to charge the same PositionalStateContainer is the parent previous stage.
osg::Matrix inhertiedMVtolocalMV;
inhertiedMVtolocalMV.invert(originalModelView);