Hello all,
we are currently developing an application which displays a large
collection of dynamic and semi-dynamic entities. We started using the
naive approach of using separate matrixtransforms for positioning each
entity and as was to be expected we are running into performance
problems as
the number of objects (>500) in a scenario is increasing. Profiling
(gDebugger) of the application points in the direction of a CPU/geometry
transfer bottleneck. Each entity in the scenario is build up as a small
scenegraph with DOFtransforms, state switches and LOD's with about 4 to
different textures (one opaque, one semi-transparent, one tiling, etc.).
We often have a zoomed out view which will cause all objects to end up
being rendered so culling is not helping us either. The top GL calls are
glCallList (all geometries) and glLoadMatrix (all transforms), but the
GPU is still more than 60% idle. Obviously this way of using OSG results
in a batch limited way of rendering, because the number of draw calls is
far too high.
Optimizations that come to mind are:
-pretransforming all semi-static objects by flattening the geometry
removes a lot of glLoadMatrix calls, but this alone won't help really
much as the number of draw calls still remains high
-combining the flattened geometry into a single vertex buffer
known as batching and viable for static geometry.
-shader instancing
creating a vertex buffer with multple instances of the same geometry
and using either a separate stream or shader constants so the vertex
shader can do the transformations
-hardware instancing
only one vertex buffer with a geometry instance which will be used
several times. Can this already be done in OpenGL?
With all of the above optimizations I am wrestling with the fact that
each entity is a mini-scenegraph instead of a single geometry. I would
like to keep the functionality of it, but for larger distances this is
not absolutely needed. I have done some archive searching and have not
found that many information on batching (typically for trees) or
instancing (osgode), and I was wondering if such optimizations could be
done at a more low level in a scenegraph rendering library like OSG. Do
other people have similar rendering scenarios and what are the typical
optimizations that they are applying?
warmest regards,
Roland Smeenk
This e-mail and its contents are subject to the DISCLAIMER at
http://www.tno.nl/disclaimer/email.html
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/