[osg-users] Strange culling of Drawables in OSG 3.5.1?

Robert Osfield robert.osfield at gmail.com
Wed Jan 27 02:13:29 PST 2016


Hi Anton,

I have reviewed the CullVisitor.cpp and CullStack/CullingSet headers
and have decided the best thing to do is make
osg::Drawable::isCullingActive() handling consistent with how other
Node's in the scene graph are handled, this does mean that code that
assumes CullingActive on a Geode will disable CullingActive on a
Drawable child will be broken so you'll need to modify your code to
handle this.  The change I made was:

$ git diff
diff --git a/src/osgUtil/CullVisitor.cpp b/src/osgUtil/CullVisitor.cpp
index 4370b83..e9e5b47 100644
--- a/src/osgUtil/CullVisitor.cpp
+++ b/src/osgUtil/CullVisitor.cpp
@@ -992,7 +992,7 @@ void CullVisitor::apply(osg::Drawable& drawable)
         }
     }

-    if (!getNodePath().empty() &&
getNodePath().back()->isCullingActive() && isCulled(bb)) return;
+    if (drawable.isCullingActive() && isCulled(bb)) return;


     if (_computeNearFar && bb.valid())

This is checked into master and OpenSceneGraph-3.4 branch.

Robert.



More information about the osg-users mailing list