Terrain rendering costs too much...

Started by
5 comments, last by Aqua Costa 13 years ago
Rendering a heightmap terrain costs too much! The terrain is made of about 500k triangles, should I reduce the number of triangles?

Also, I have to render the terrain at least 5 times per frame, one to GBuffer, 4 times to each shadow map cascade and another one for the second geometry pass...

What's your advice to increase performance? How many triangles do terrains need in average? Should I draw the terrain to a different single shadow map?

P.S: Rendering the terrain costs over 12 ms and makes my game GPU (vertex shader) bound.
Advertisement
By the sounds of it you don't have a level-of-detail system?

Have a looked at 'chunked lod' and 'geo clipmaps'.

As for triangle counts -- enough to avoid jagged silhouettes, but not so many that they become sub-pixel sized.
Yeah, it sounds like you aren't using LODing as Hodgman points out, also based on the vertex costs I'm going to guess that you haven't broken up your terrain into segments for rendering so you can cull segments to view frustums and only draw chunks which can be seen.
Before using LODs you can try using Meshes for the terrain. I was loading a huge terrain consisting out of 250k faces and my framerate broke down to less then 1 FPS. Calling D3DXCleanMesh() and D3DXGeneratePMesh() to optimize the mesh and to generate a progressive mesh somehow made me able to draw the same terrain with full 60 FPS (its consisting of about 100 subsets). I'm not an expert, but thats something you might want to try out.

Rendering a heightmap terrain costs too much! The terrain is made of about 500k triangles, should I reduce the number of triangles?

Also, I have to render the terrain at least 5 times per frame, one to GBuffer, 4 times to each shadow map cascade and another one for the second geometry pass...

What's your advice to increase performance? How many triangles do terrains need in average? Should I draw the terrain to a different single shadow map?

P.S: Rendering the terrain costs over 12 ms and makes my game GPU (vertex shader) bound.

There has got to be some way for you to cut down on the number of times you're rendering your scene. 5 per frame is OBSCENE.
In any kind of cascading shadow mapping, or parallel shadow mapping, the entire scene needs to be rendered for as many splits there are. It is unfortunate, but necessary. I guess the only upside, is that only depth information is written :P
Wisdom is knowing when to shut up, so try it.
--Game Development http://nolimitsdesigns.com: Reliable UDP library, Threading library, Math Library, UI Library. Take a look, its all free.

In any kind of cascading shadow mapping, or parallel shadow mapping, the entire scene needs to be rendered for as many splits there are. It is unfortunate, but necessary. I guess the only upside, is that only depth information is written :P

I'm culling the other objects using each cascade frustum, so I just have to draw each object once (or twice if the mesh is between two cascades).

I will create the terrain in smaller separate pieces and do the same thing :D

This topic is closed to new replies.

Advertisement