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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to