Hi Jamie, On 24 April 2014 10:05, Jaime <xatp...@hotmail.com> wrote: > Thanks for your response! > > I have a lot (5000 aprox) of trees in my example scene. Each tree has got two > planes and textures. However, my terrain geometry is relatively simple. I > think that the terrain is not the problem. And there are some buildings in > some places. Also, there are cars and pedestrians. So, it is a "complex" > scene. > > Nowadays, the performance is not good (20 fps aprox). We are not using any > LOD nodes. Because of that, I thought in that solution. > > What are your tips? How about using VisibilityGroup?
The first task should be profiling the database and the performance and relatively balance of update, cull and draw you are getting. Making sure all tests are done with release build. Nodes in the scene graph can be a performance bottleneck with poorly balanced scenes, or scenes that that have very large numbers of transforms and unique state. For instance if each tree is a separate osg::Geometry, with a separate Transform above it placing it then you'll get poor performance when all the trees are in view. 5000 trees is actually a very small number of vertices and primitives so could easily be batched into a small set of osg::Geometry that have all the trees within a particular area clustered together so that culling can still work well. You can also look at techniques like geometry instancing or shaders that place trees - see the osgforest example that demonstrates a range of different ways you can do large numbers of trees from very simple use of Billboards and Transform to using shaders. The shader approaches scale very well to large number of trees with small CPU and GPU overhead. The same approaches can be used for other objects that get instanced lots of times. There are many different ways to optimize you scene, we've only covered a tiny number here in this thread, it's such a huge and open ended topic that it's not possible to try and cover everything in single thread. There have been lots of discussions about optimization of scene graphs over the years on osg-users mailing list/forum so have a look through the archives. Robert. _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org