HI Clayton?  Bluhm?  Could you sign with your first name so we know
who to address, thanks.

On Tue, Dec 22, 2009 at 1:30 PM, Clayton Bluhm <[email protected]> wrote:
> I am new to OSG.  I am trying to draw a lot of spheres into a scene.  By lots 
> I mean on the order of a 100,000 or so.  This really brings my simple test 
> app to its knees.  Here is the current way I am drawing these spheres:

I regret the day I wrote ShapeDrawable.  It has to be the most abused
class in the OSG's history. It's a quick and dirty convenience class
for visualizing primitive shapes, but has ended getting used to do
lots of tasks it really isn't suited for... drawing hundreds of
thousands of sphere's is just another example.

So my first bit of advice is drop ShapeDrawable and implement what you
need using osg::Geometry that contains points, and use the osg::Point
& osg::PointSprite StateAttribute to control the visualization of the
points.  Have a look at the osgpointsprite example.

If you absolutely have to use real geometry rather than point spites
than using an osg::Geometry and build the geometry at the level of
tessellation you need. see osggeometry for an example of geometry
creation.  Other potential developments would be to use geometry
instancing, or a custom drawable.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to