Hello all, (crossposting to osg-ephemeris as this is related to it)
In trying to optimize our scenes, I have found out that the osgEphemeris skydome is pretty inefficiently organized in terms of what we've been talking about in the other thread (see "Optimizing scene structure and geometry" on osg-users: http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/64850 ).
The skydome is built with 4 geodes, each of which has 4 geometry objects, each of which has 9600 vertices drawn with 48 primitivesets (DrawArrays of TRIANGLE_STRIPs). The strips in each geometry start at 3 triangles and go up to 97 in steps of 2. So that's pretty poor batching.
I can understand the 4 geodes, and perhaps even 16 geometry, as they'll make culling effective and will result in less geometry drawn when it's not visible. And I think 4 geodes and 16 geometry isn't too bad in the grand scheme of things. But these 768 small strips have to go. :-)
I'm guessing the geometry is organized in strips going from the top of the sphere to its equator, and this must be done in order to be able to color the sphere horizontally when the sun sets. However, there must be a more efficient way.
Other than doing the coloring with a texture, which might be the most efficient way but would mean too drastic code changes I think, would there be a way to convert the 48 primitive sets to a single DrawElements of TRIANGLES, without affecting the vertex array (or the others)? That way it would be better batched, but would retain the possibility to color the dome in the same way as it is now. I'll have a look at the INDEX_MESH optimizer to get some idea of how that would work, is that a good place to start?
If anyone has the time or interest to look at the code for osgEphemeris, it's available at http://www.andesengineering.com/Projects/OsgEphemeris/ . I'll be trying to make it more efficient, because it proves to be part of our problem.
Thanks in advance, 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

