Hi Jimmy,
I would like to know what is the Cull time in the osg stats (the blue bar) means. I notice it changes together with draw time when I zoom in/out of my scene.
Cull time is both the time to do the actual culling, and the time it takes to traverse the scene graph and build the draw list (flat list of all drawables and state that need to be drawn in the frame).
This list is then traversed in the draw stage, which is the draw bar (a better name for this is the "draw dispatch" - draw commands are sent to OpenGL). The GPU time is the actual time taken to do the drawing.
I tried to disable the camera cull by setting NO_CULLING for the camera, but it didn't remove the cull time at all. It looks like the Cull time in the stats is some sort of culling which is done after the camera cull, probably is the CullVisitor. Is there a way to skip this culling process? I am trying to improve my app's performance at the moment. I know I can use DrawThreadPerContext instead of SingleThread. and also reuse my StateSet/StateAttribute to improve a bit. But both of them require major code change on my app. And most of time the whole scene should be rendered in my app anyway, so there is not much point to do culling, and if it can be disabled, I think it will increase my performance a lot.
As I said above, the CullVisitor doesn't only do culling. And the culling it does is not very costly. Doing setCullingActive(false) does work, and if it doesn't give better results, it proves that culling is not your problem.
The large cull time indicates that traversing the graph is taking a lot of time. This is most likely caused by having a very flat scene graph. If most of the time you add objects to the root of the graph, then this might be your problem. Making your graph more spatially distributed (i.e. groups that are close together put as children of a common group), and also perhaps merging objects that will always be seen together (i.e. removing group nodes) will probably help. You have way too many groups compared to drawables.
Your draw time is also very high. As you said, sharing state and sharing arrays (vertex, normal, color, texcoord arrays) will help a lot. You seem to have about 27 vertices per drawable (77303/2815) which is very little. You should group many such drawables as one drawable, or if this is not possible, put the vertices for many drawables in a single vertex array, and make the drawables share the array, with the appropriate PrimitiveSets to draw the right part of the shared vertex array. Generally graphics cards work best when several thousand vertices are sent in a batch, so this will most probably help a lot with your draw time.
Hope this helps, J-S -- ______________________________________________________ Jean-Sebastien Guay [email protected] http://www.cm-labs.com/ http://whitestar02.webhop.org/ _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

