-
Notifications
You must be signed in to change notification settings - Fork 41
Notes
Random notes.
Currently, tiling dangerously multiplies polygon count:
Level #Tils Lines Tris Quads
None 1 2800740 187008 2084056
10 24 2824190 217803 2082132
11 84 2830148 251538 2074692
12 276 2840420 311439 2061616
13 1058 2864136 435651 2034552
14 4232 2913096 673050 1983936
15 16836 3012734 1153107 1884364
To counter this, support for generic convex polygon primitive is needed (rendered as triangle fan). This
- conserves vertex space for large polygons
- allows to get rid of quads
- helps cropping, as quad split in half now produces two fans (8 vertices) instead of four triangles (12 vertices).
On the other side, for tiler geometry tiling improves performance greatly.
Time required for rendering Moscow at z18 depending on tiling level:
Level Tiles/second (rendering only)
10 391.58
11 1215.67
12 3294.44
13 5477.83
14 6740.94 (!)
15 4881.76
16 2312.13
17 750.81
When higher tiling level (thus smaller tile size), rendering speed grows as it only renders polygons which are visible on this tile, however polygon overhead due to geometry splitting (see above) grows as well as number of state changes and general TileManager overhead. Obviously, optimal tiling level varies among rendering levels.
Table of optimal tiling for each tile level:
Level Tiling
...
11 11
12 12
13 12
14 12
15 12
16 13
17 13
18 14
After moving geometry from separate arrays of triangles and quads which were rendered with glDrawArrays to a more generic array of convex polygons, following rendering methods became possible:
- All polygons are rendered as triangle fans with glMultiDrawArrays
- Polygons are converted to triangles and rendered with single glDrawArrays
- Polygons are converted to triangles and quads and rendered with two glDrawArrays
- Polygons are converted to vertex array with index and rendered with single glDrawElements
Performance results:
Method #Vertices FPS
Fans 3.38M 85.5
Tris 4.91M 77.2
Tris+quads 3.41M 95.4
Elements 3.38M 95.8