Hi again,

So I've been able to at least partially implement some suggestions that I was given in the previous posts by Tim and Robert. Here are some results in before-after style.

Scene stats haven't changed significantly.

Camera stats:       Before          After
State graphs          1254            846
Drawables             2117           1669
Vertices            485531         368844
PrimitiveSets         4899           1694
Triangles            17122         161448
Tri. Strips            191             32
Tri. Fans             7212             36
Quads               106464           9578
Quad Strips            534            356
Total primitives    131523         171450
Vertices per pset     99.1          217.7

This was achieved by doing 2 things:

* Uniformizing even more state, even if it leads to graphical artifacts (our artist can go in and fix those later), for instance cull face settings. This made texture atlas generation more effective which lowered number of state sets / state graphs.

* Backporting the INDEX_MESH, VERTEX_PRETRANSFORM and VERTEX_POSTTRANSFORM optimizers into my optimization tool which uses OSG 2.8.3. This lowered the number of PrimitiveSets by combining and converting primitive sets to all use indexed triangle lists.

However, in our simulator itself as well as when testing with a dumped scene in the osgshadow example, even though these numbers are lower, they did not result in a large cull/draw time reduction, and so the frame rate is still largely the same (improved from ~35 to ~40 fps). So I guess even though I more than doubled the number of vertices per primitiveset, the numbers (state graphs and primitive sets) are still much too high.

My next step is eliminating textures that repeat, to even further improve texture atlas generation. This will again lead to some graphical artifacts unfortunately...

I did the test of removing almost all statesets after scene load. The result was that most of the time, the frame rate was close to or at 60. In the worst case scenario (whole scene visible, which is also what I'm giving you stats for since the beginning) it went to about 50 fps in our simulator, so it's not just statesets that are a problem. I think I really need to lower statesets and primitivesets in combination to be able to get good results.

I'll also look at decreasing the cull time, since in practice that should pay off in double (because of the shadow pass) and even quadruple or more sometimes (ocean can have reflection turned on, for now we've turned it off; also we often have extra picture-in-picture view(s) to render in addition to the main view).

Any further comments would be appreciated. Also any suggestions as to what else I can do would be appreciated as well. At least I'm starting to see some results, which is encouraging since up until now nothing I had done had had a significant effect (I was scrounging 1 fps here, 0.5 fps there...).

Thanks in advance,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to