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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user