I’ve got a scene with a terrain of 1024x1024 cells, i.e. 2 million triangles in one big mesh using a displacement map. My problem: The fps rate is slowly dropping as soon as I add more and more features to my shaders.
Example: I added six texture samplers to my material and suddenly the fps rate dropped from 59 to 25.
How do I achieve a good framerate? What are the key factors that I need to keep in mind in order to keep the fps high? What are the bottlenecks in current OpenGL hardware (e.g. the Radeon Pro 570 on my iMac, or the slower Intel HD Graphics 5000 on my Macbook Air)?
Should I invest in…
- subdividing the terrain into tiles so that frustum culling might kick in…
- reducing the number of triangles in the terrain (i.e. find an algorithm to replace several almost coplanar triangles by fewer ones)
- do some LOD tricks (I’ve got no idea about this…)
- or what else could I do?
What do you think is the best way to render a terrain quickly? And: How do I measure time on the GPU to find out what the time-consuming part of my shader really is?