For cases where the RenderBin has its own StateSet do a popAllStateSets()

to ensure that the state is completely ready for the RenderBin's StateSet to be at the bottom.
This commit is contained in:
Robert Osfield
2006-07-19 20:56:24 +00:00
parent dbf1e05a71
commit 0af758716a

View File

@@ -367,6 +367,11 @@ void RenderBin::drawImplementation(osg::State& state,RenderLeaf*& previous)
if (_stateset.valid())
{
// first need to flush the stack
previous = 0;
state.popAllStateSets();
// now its safe to push RenderBin's StateSet as we now know its the root.
state.pushStateSet(_stateset.get());
}
@@ -417,16 +422,10 @@ void RenderBin::drawImplementation(osg::State& state,RenderLeaf*& previous)
rbitr->second->draw(state,previous);
}
// now reset the state so its back in its default state.
if (previous)
{
StateGraph::moveToRootStateGraph(state,previous->_parent);
previous = NULL;
}
if (_stateset.valid())
{
state.popStateSet();
state.popAllStateSets();
previous = 0;
}
//osg::notify(osg::NOTICE)<<"end RenderBin::drawImplementation "<<className()<<std::endl;