I am having performance problems when drawing lots of grass zoomed out in an RTS like tropico.
Here is some background ...
1) The grass is already very low poly. Basically a blade of grass is 2 triangles (4 since it is dual-sided).
2) When fully zoomed out I believe I'm drawing 8-1000000 blades of grass.
3) The world is divided into square zones. 16x16=256 of them.
4) Static objects including grass is rendered in a single call to glDrawElements for each zone.
5) I use some simple math to determine if a particular zone is in view and thus drawn.
6) This works well when I'm zoomed in but performance drags when I'm zoomed out and
have to draw too many zones.
7) My grass is built up from individual blades into clumps and then multiple clumps into patches.
Here is an idea swimming in my head ...
1) When zoomed in, we obviously draw the grass in its dense glory. That is draw all the blades.
2) When zoomed out, it is probably OK to draw the grass much more sparsely.
3) Currently, the idea is to have less blades per clump of grass.
To achieve this ...
1) Sort the elements (blades of grass) so that we draw in the following way. See example below.
2) Start with blade1, clump1, patch 1 (1,1,1) then blade (2,1,1), (3,1,1),(4,1,1),
3) Then onto the next patch and so on.
4) Now for high LOD (zoomed in) we draw more elements in glDrawElements.
5) For low (LOD) we simply draw less elements
What do u guys think of this scheme?