Jump to content
  • Advertisement
Sign in to follow this  
Aqua Costa

Terrain rendering costs too much...

This topic is 2779 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!