Removed StateSet::ENCLOSE_RENDERBIN_DETAILS since it is rendendent, and
implemented the OVERRIDE_RENDERBIN_DETAILS.
This commit is contained in:
@@ -327,8 +327,7 @@ class OSG_EXPORT StateSet : public Object
|
||||
{
|
||||
INHERIT_RENDERBIN_DETAILS,
|
||||
USE_RENDERBIN_DETAILS,
|
||||
OVERRIDE_RENDERBIN_DETAILS,
|
||||
ENCLOSE_RENDERBIN_DETAILS
|
||||
OVERRIDE_RENDERBIN_DETAILS
|
||||
};
|
||||
|
||||
/** Set the render bin details.*/
|
||||
|
||||
@@ -92,10 +92,14 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
|
||||
inline void pushStateSet(const osg::StateSet* ss)
|
||||
{
|
||||
_currentStateGraph = _currentStateGraph->find_or_insert(ss);
|
||||
if (ss->useRenderBinDetails())
|
||||
if (_numberOfEncloseOverrideRenderBinDetails==0 && ss->useRenderBinDetails() && !ss->getBinName().empty())
|
||||
{
|
||||
_currentRenderBin = _currentRenderBin->find_or_insert(ss->getBinNumber(),ss->getBinName());
|
||||
}
|
||||
if (ss->getRenderBinMode()==osg::StateSet::OVERRIDE_RENDERBIN_DETAILS)
|
||||
{
|
||||
++_numberOfEncloseOverrideRenderBinDetails;
|
||||
}
|
||||
}
|
||||
|
||||
/** Pop the top state set and hence associated state group.
|
||||
@@ -104,9 +108,18 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
|
||||
*/
|
||||
inline void popStateSet()
|
||||
{
|
||||
if (_currentStateGraph->_stateset->useRenderBinDetails())
|
||||
const osg::StateSet* ss = _currentStateGraph->_stateset;
|
||||
if (_numberOfEncloseOverrideRenderBinDetails==0 && ss->useRenderBinDetails() && !ss->getBinName().empty())
|
||||
{
|
||||
_currentRenderBin = _currentRenderBin->getParent();
|
||||
if (_currentRenderBin->getParent())
|
||||
{
|
||||
_currentRenderBin = _currentRenderBin->getParent();
|
||||
}
|
||||
}
|
||||
if (ss->getRenderBinMode()==osg::StateSet::OVERRIDE_RENDERBIN_DETAILS)
|
||||
{
|
||||
--_numberOfEncloseOverrideRenderBinDetails;
|
||||
}
|
||||
_currentStateGraph = _currentStateGraph->_parent;
|
||||
}
|
||||
@@ -269,6 +282,8 @@ class OSGUTIL_EXPORT CullVisitor : public osg::NodeVisitor, public osg::CullStac
|
||||
|
||||
inline RenderLeaf* createOrReuseRenderLeaf(osg::Drawable* drawable,osg::RefMatrix* projection,osg::RefMatrix* matrix, float depth=0.0f);
|
||||
|
||||
unsigned int _numberOfEncloseOverrideRenderBinDetails;
|
||||
|
||||
osg::ref_ptr<osg::State> _state;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user