Increasing terrain performance (loading + drawing)

Started by
32 comments, last by gnmgrl 11 years, 8 months ago
Looks like a bandwidth problem after all.

Your vertex buffer is huge. Why do you need so much data? Why shadow color?
Why is your index buffer * 6? You should be using a triangle strip, not a triangle list.
Since you are bandwidth limited, this is one of the major issues you need to handle.
If you switch to triangle strips, your index buffer should become 257 * 257 + 2.
That in itself is much smaller but restricting your index buffers to 16 bits (while increasing the number of draw calls) often proves worth the extra draw calls.
But before reducing your index buffer to 16 bits, start by using a triangle strip. You should see a noticeable gain in performance.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Advertisement
I can't really see how to cut the vertexBuffer shorter. I could cut the shadowColor and just use bool for shadowed/not shadowed, but that would be all.
I'm using a trianglelist because I was told that doing so reduces the number of vertices while increasing the number of indices, which is a good thing they said, I didnt know that a triangleleist is more performant.

A 16-bit indexbuffer can simply be created by, instead of unsinged long, using unsinged short and IASetIndexBuffer( indexBuffer, DXGI_FORMAT_R16_UINT, 0);?
To go with a trianglestrip, I have to rebuild the entire terraincode, which could take a while. But if you say that it is worth it, I'll go for that.

Thanks for your instense help!

http://www.gamedev.net/topic/447265-triangle-strip/
2007 they said we should use triangleLists! Has so much changed since then?
Cache-friendly vertex buffers is another issue worth investigating.
By the size of your vertex buffer it appears you have repeating vertex data. If you are using an index buffer, your vertex buffer should be much smaller (257 × 257).
Are you eliminating duplicate vertices? If not, this would be the first thing to do.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

You got me wrong, I think. My vertex buffer is only 257*257. There are no doubled vertices.
Because I'm using a trianglelist, I need more indices. Most tutorials and posts said that would be worth it by far.

The problem I'm currently facing is that I cant figure out how to stream the y-values to the shader properly.
Another thing I just noticed is that, when I pass the y values per chunk to the shader, I have to do the same thing for shadows and normals. Will this still be a performance increase?

This topic is closed to new replies.

Advertisement