From Richard Schmidt, "attached you will find a set of small fixes and features.

CullVisitor/SceneView:

*Feature: This version supports multiple clearnodes in the graph, one per renderstage.

 

Text:

*Feature: Performance Enhancement when calling SetBackdropColor

 

Material:

*Fix: OpenGL calls are now made according to the OpenGL Standard

"
This commit is contained in:
Robert Osfield 2007-12-10 20:30:05 +00:00
parent 9d260213f7
commit c5704586f9
3 changed files with 11 additions and 25 deletions

View File

@ -92,9 +92,6 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
virtual void apply(osg::Camera& node);
virtual void apply(osg::OccluderNode& node);
void setClearNode(const osg::ClearNode* earthSky) { _clearNode = earthSky; }
const osg::ClearNode* getClearNode() const { return _clearNode.get(); }
/** Push state set on the current state group.
* If the state exists in a child state group of the current
* state group then move the current state group to that child.
@ -286,8 +283,6 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
else acceptNode->accept(*this);
}
osg::ref_ptr<const osg::ClearNode> _clearNode;
osg::ref_ptr<StateGraph> _rootStateGraph;
StateGraph* _currentStateGraph;

View File

@ -1090,7 +1090,17 @@ void CullVisitor::apply(LOD& node)
void CullVisitor::apply(osg::ClearNode& node)
{
// simply override the current earth sky.
setClearNode(&node);
if (node.getRequiresClear())
{
getCurrentRenderBin()->getStage()->setClearColor(node.getClearColor());
getCurrentRenderBin()->getStage()->setClearMask(node.getClearMask());
}
else
{
// we have an earth sky implementation to do the work for use
// so we don't need to clear.
getCurrentRenderBin()->getStage()->setClearMask(0);
}
// push the node's state.
StateSet* node_state = node.getStateSet();

View File

@ -764,9 +764,6 @@ bool SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod
cullVisitor->inheritCullSettings(*this);
cullVisitor->setClearNode(NULL); // reset earth sky on each frame.
cullVisitor->setStateGraph(rendergraph);
cullVisitor->setRenderStage(renderStage);
@ -829,22 +826,6 @@ bool SceneView::cullStage(const osg::Matrixd& projection,const osg::Matrixd& mod
if (_globalStateSet.valid()) cullVisitor->popStateSet();
const osg::ClearNode* clearNode = cullVisitor->getClearNode();
if (clearNode)
{
if (clearNode->getRequiresClear())
{
renderStage->setClearColor(clearNode->getClearColor());
renderStage->setClearMask(clearNode->getClearMask());
}
else
{
// we have an earth sky implementation to do the work for use
// so we don't need to clear.
renderStage->setClearMask(0);
}
}
renderStage->sort();
// prune out any empty StateGraph children.