Hi Mike,

I have an OSG application where I am using osg::Shapedrawable(new osg::Sphere(...)) to represent errors ellipsoids (all have various sizes and locations) for targets on a terrain. Prior to their introduction into the scene, I am getting around 40 frames per second. After introducing 1000 of them, my frame rate goes down to 4-5 frames per second.

[...]

My viewer is set up in an overhead view, so I see them all every frame (i.e., I don't think culling will help here). And also, their PATs have to occassionally be updated (i.e., not static size, orientation, position).

If you see 1000 spheres in the window at the same time, I'm guessing that even if they don't look like spheres up close it won't make much difference from afar. So you could look into the osg::TessellationHints class which you pass to osg::ShapeDrawable when constructing your spheres. Setting the detail ratio to 0.5 for example would reduce the number of polygons. See how low you can go before it becomes unacceptable. Perhaps you can even set up an LOD structure where close up you would have a sphere with detail ratio 1.0, but further away it would have 0.5, then 0.2, then 0.1...

As a general note, osg::ShapeDrawable is intended for quick prototyping, not for heavy use. If you want some more optimal geometry, you could for example create a sphere in any 3D modeling program, run that through the Optimizer with the TRISTRIP_GEOMETRY option (which is not enabled by default) and you would have better-performing geometry, and it would be more customizable to what you need (detail level).

If you want to know more about how osg::ShapeDrawable constructs the geometry from osg::Shapes, have a look at src/osg/ShapeDrawable.cpp.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [EMAIL PROTECTED]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to