From Frashid Larshkari, "I modified the vertical/horizontal interlace stereo modes so that they

use the osg::State::applyMode for enabling/disabling certain while
rendering the stencil mask. Previously some of these calls were
overriding the scene graph states because the global state was not
aware of this change.

"
This commit is contained in:
Robert Osfield
2008-08-15 17:25:42 +00:00
parent 5400e570c7
commit 0448b31f93

View File

@@ -1275,14 +1275,14 @@ void SceneView::draw()
glOrtho(getViewport()->x(), getViewport()->width(), getViewport()->y(), getViewport()->height(), -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
getState()->applyMode(GL_LIGHTING,false);
getState()->applyMode(GL_DEPTH_TEST,false);
glStencilMask(~0u);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
glStencilFunc(GL_ALWAYS, 1, ~0u);
glPolygonStipple(patternVertEven);
glEnable(GL_POLYGON_STIPPLE);
getState()->applyMode(GL_POLYGON_STIPPLE,true);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glRecti(static_cast<GLint>(getViewport()->x()),
@@ -1291,9 +1291,9 @@ void SceneView::draw()
static_cast<GLint>(getViewport()->height()) );
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDisable(GL_POLYGON_STIPPLE);
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
getState()->applyMode(GL_POLYGON_STIPPLE,false);
getState()->applyMode(GL_LIGHTING,true);
getState()->applyMode(GL_DEPTH_TEST,true);
_redrawInterlacedStereoStencilMask = false;
_interlacedStereoStencilWidth = static_cast<int>(getViewport()->width());
@@ -1352,14 +1352,14 @@ void SceneView::draw()
glOrtho(getViewport()->x(), getViewport()->width(), getViewport()->y(), getViewport()->height(), -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
getState()->applyMode(GL_LIGHTING,false);
getState()->applyMode(GL_DEPTH_TEST,false);
glStencilMask(~0u);
glClear(GL_STENCIL_BUFFER_BIT);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
glStencilFunc(GL_ALWAYS, 1, ~0u);
glPolygonStipple(patternHorzEven);
glEnable(GL_POLYGON_STIPPLE);
getState()->applyMode(GL_POLYGON_STIPPLE,true);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glRecti(static_cast<GLint>(getViewport()->x()),
@@ -1368,9 +1368,9 @@ void SceneView::draw()
static_cast<GLint>(getViewport()->height()) );
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDisable(GL_POLYGON_STIPPLE);
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
getState()->applyMode(GL_POLYGON_STIPPLE,false);
getState()->applyMode(GL_LIGHTING,true);
getState()->applyMode(GL_DEPTH_TEST,true);
_redrawInterlacedStereoStencilMask = false;
_interlacedStereoStencilWidth = static_cast<int>(getViewport()->width());