Hi Andrew,

The scale of number of separate objects you want to handle is
extremely high, so will require a range of different techniques to get
performance to an acceptable level.

Techniques you'll want to employ will certainly including LOD's,
PagedLOD's, flattening static transforms (as per your suggestion of
avoiding PATs), sharing as much state as you can, optimizing the
meshes of the geometries you have.  Please note that the OSG has Small
Feature Culling turned on by default, you can tune this via the
Viewer's Camera's osg::CullSettings (see include/osg/CullSettings.)

You will also need to find a way to efficiently manage your scene
graph so that it is a balanced quad or oct tree rather a flat tree of
thousands of objects as a flat tree forces the cull visitor to
traverse ever child as it can't do any early culling.

Robert.

On Wed, Jul 8, 2009 at 4:32 PM, Andrew
Burnett-Thompson<aburnettthomp...@googlemail.com> wrote:
> Hi there,
>
> I am developing an application using OpenSceneGraph, which is essentially a
> visualisation tool for industrial plants. Part of the remit is to be able to
> load in scenes with literally millions of objects.
>
> The application loads objects from a proprietary format, so what I get is a
> list of objects to draw. Objects can be a number of primitive types, which
> include Cylinders, Cones, Spheres, CubesĀ and Tori, as well as Polyface
> Meshes. All of the primitive types (Except meshes) are constructed from a
> number of parameters upon load, for instance, cones have start/end radius
> and length.
>
> Each object must be selectable and movable in this application, so the user
> has full control over position, attutude, scaling as well as custom
> properties of the primitive (if any).
>
> In order to do this I have a prototype that calculates the
> vertices/primitives say for a cylinder on load, stores it in a Geode as
> osg::DrawArrays. Then to position the cylinder, I put this as a child to a
> osg::PositionAttitudeTransform with the appropriate position, rotation and
> scale.
>
> As a result I end up with a very flat scenegraph with a lot of PAT's at the
> first level and Geodes at the second level. When I render my scene the
> framerate drops to about 5FPS (for 50,000 cylinders) when all are in view.
> At 300,000 cylinders, well its pretty much dead! (Note: Hardware is ATI
> 3850, 512MB RAMĀ Intel Core 2 Duo)
>
> Now a little digging and I find that PAT's essentially compute 4x matrix
> multiplies per object visible per frame, so these are obviously not designed
> to be used in this way (one per object). So my question is:
>
> -- Exactly how do you draw a really large scene containing hundreds of
> thousands, or even millions of primitives, but allow the user to
> pick/select/move the individual objects without having 1x PAT per Geode?
>
> -- I was thinking of the solution to not have PAT's and position the
> primitive vertices in global space, then when the user wishes to move them,
> attach a PAT as the parent, do the move, and detach the PAT. This would
> require performing a matrix multiply of the PAT coefficients with the
> vertices before/after the operation but would save significantly on
> overhead. Does this sound reasonable?
>
> Finally with regard to the 1.5m object target, an old application (that we
> are replacing) uses a method of culling whereby the smallest 80% of objects
> are culled from the application as you move around the scene. This
> significantly reduces render time, but memory overhead is still very high.
> Ideally I would like to use paging but not sure how this is possible as we
> need to serialize our custom properties (such as Primitive Type, cylinder
> radius 1, 2, length etc) with the objects as they are saved.
>
> Any help would be greatly appreciated,
>
> Thank you,
> Andrew Thompson
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to