Fixed pre compilation osg::Program state leaking into the main scene graph rendering

This commit is contained in:
Robert Osfield
2017-10-25 16:13:26 +01:00
parent c8bd6fd100
commit 248805fedd
3 changed files with 21 additions and 2 deletions

View File

@@ -153,6 +153,23 @@ void GLObjectsVisitor::apply(osg::StateSet& stateset)
}
}
void GLObjectsVisitor::compile(osg::Node& node)
{
if (_renderInfo.getState())
{
node.accept(*this);
if (_lastCompiledProgram.valid())
{
osg::State* state = _renderInfo.getState();
osg::GLExtensions* extensions = state->get<osg::GLExtensions>();
extensions->glUseProgram(0);
_renderInfo.getState()->setLastAppliedProgramObject(0);
}
}
}
/////////////////////////////////////////////////////////////////
//
// GLObjectsOperation