Why preformance is droping down when I load for example a 4900 of nodes to scene? If there a 125 it's ok, 200 still ok, but if there are more of them rendering framerate is droping dramaticaly? Root node contains childs that contains (model (in 3ds) + texture + some science calculation) and all created in cylce from 0 to 4899. I have tried to use osgUtil::Optimizer on root after all childs where in place but still no improvments. Tried to put all nodes in one geode but it didn't help too. How can I achieve balance between performance and number of nodes?
4900 nodes seems an awful lot of nodes!
You should start reading about LOD
and PagedLOD
.
PageLOD
will improve the performance. The idea is like this (imagine that the first image is a lot farther):
Since you are far far away, you don't want a lot of detail. But when you zoom in, you want to see those details. You'll have to specify what models go in each LOD
level and how you want to activate them. That's the tricky part.
Also, check if you can share nodes. For example, instead of having 4 different wheels, you just create one wheel. Then, add 4 PositionAttitudeTransform/MatrixTransform and add the wheel node to each of them.
The same goes for StateAttributes
, share them when possible!
Finally, if you have a lot of repeated geoms, take a look at geometry instancing.