I'm trying to better understand culling in OSG. I've written two sample apps that each build 10 triangles.

In application one, each triangle is stored in a osg::Geometry object which is owned by a unique osg::Geode object. Each osg::Geode object is stored in a group. So that's 10 osg::Geometry objects and 10 osg::Geode objects. When I run that app and toggle instrumentation, I see there are 10 drawables and 10 primitives. When I pan the scene around, each time a triangle goes out of view the drawable count goes down by one. I take this to mean that OSG has culled the drawable when it goes out of view. OK, so far so good, culling appears to work except I don't like storing each primitive in its own node. Which brings me to application two.

Application two stores all 10 triangles in one geode object. That is, I build 10 osg::Geometry objects. Each osg::Geometry object contains a single triangle. All 10 osg::Geomtry objects are stored in one osg::Geode object. When I run that app and toggle instrumentation, I see there is 1 drawable and 10 primitives. When I pan the scene around, nothing appears to be culled until all 10 triangles are off-screen. That is, my drawable count decrements by one when all 10 triangles are off-screen.


Why, in the second app, do I only see 1 drawable? I added 10 drawables to a osg::Geode object. Am I misunderstanding what is meant by a drawable? Culling...I thought culling was done at the node level AND at the drawable level. Correct? What am I doing wrong here? It appears that all 10 osg::Geometry objects are lumped together in application two, why?





_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to