From Farshid Lashkari, "Anaglyphic stereo does not seem to work properly when performing pre-render stages. I believe the reason is that the pre-render stages are performed with the last applied color mask, which is cyan. I've fixed this by resetting the color mask before performing the pre-render stages."

This commit is contained in:
Robert Osfield
2010-04-20 11:13:27 +00:00
parent eef7da35d1
commit 6a73dfc193

View File

@@ -1112,6 +1112,20 @@ void SceneView::draw()
_renderStageRight->setDrawBuffer(_camera->getDrawBuffer());
_renderStageRight->setReadBuffer(_camera->getDrawBuffer());
}
// ensure that all color planes are active.
osg::ColorMask* cmask = static_cast<osg::ColorMask*>(_localStateSet->getAttribute(osg::StateAttribute::COLORMASK));
if (cmask)
{
cmask->setMask(true,true,true,true);
}
else
{
cmask = new osg::ColorMask(true,true,true,true);
_localStateSet->setAttribute(cmask);
}
_renderStageLeft->setColorMask(cmask);
_renderStageRight->setColorMask(cmask);
_localStateSet->setAttribute(getViewport());