Sign in to follow this  
Aqua Costa

Terrain rendering costs too much...

Recommended Posts

Aqua Costa    3692
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
_the_phantom_    11250
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
Juliean    7077
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
DragonGeo2    100
[quote name='TiagoCosta' timestamp='1302422747' post='4796601']
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.
[/quote]
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
smasherprog    568
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
Aqua Costa    3692
[quote name='smasherprog' timestamp='1302501787' post='4796955']
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
[/quote]
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this