There is especially one thing that kills frame rate : it's when we render trees. We tried two approaches, first being as in IL-2 Sturmovik (several planes rendered as layers using alpha test), second is for a closer view and we render our trees with simple geometry (we use 800 polys meshes, no billboards, only a lot of alpha tested planes for leaves). Both approaches cuts frame rate by 4 or so (from 90fps down to 10-30).
I suppose the only thing that could speed up everything would be to render front to back. Is there anything else that could improve frame rate for this specific problem ?
Another track I follow is batching :
All the planes of the 800 polys trees are different meshes, and thus are rendered with different glDrawElements, fragment / vertex program switch between each (even if they are the same). But, the frame rate is changing a lot depending on the point of view, so I suppose it comes from overdraw. Of course, it's planned to batch everything correctly some day.
So about that front to back sorting ... I try to cull each mesh at each frame, so I get a Z information after culling, if the mesh is not culled (frustum culled). I could sort according to that Z value, and I'm wondering what algorithm would be the most efficient.
1- Brute force quick sort
2- Some kind of hash table depending on Z
3- BSP on bounding volumes (geometry is static)
All suggestions are really welcome,