Skip to main content
GameDev.net gamedev.net
🔒 Locked

Terrain Index Buffer

Started by colinolivant Jan 14, 2007 at 12:38 PM 0 replies 1.5k views
Original Post
colinolivant
colinolivant
Hi, I am implementing a terrain system with lod. I have taken a 512 by 512 heightmap and loaded all of it into 4 "256 by 256" vertexbuffers. My question is do I either create 1 index buffer for each vertexbuffer. This will need to be changed every time the lod needs updating. Or do I create lots of smaller buffers for each lod patch "64 by 64" and change each one of them when the lod is updated. Or do I create a index buffer for each lod level and each grid? This means I don’t need to change any buffers in runtime. I am confused and don’t want to implement each one to find out which one works the best. I think the best idea is having a index buffer for each lod level and each grid. That means all I have to do is render the specific buffers I need. The down size is I don’t know how much memory that would take up. Any help would be grateful Thank you C.
damsku
damsku
Hmm. What about having one index buffer which contains all indexes for each lod level and offset the buffer to get the wanted lod level?
Then use a single x,z vertex buffer shared for each patch and one y, normal... per patch (that you can upload while moving so you can end up with pretty huge terrain)? (eventually split to more than 1 vertex buffer if the patch size is ridiculously high).
You will most likely need more index buffers to fix the TJunctions between patches of different LOD but you will be able to offset them in the same index buffer too.
I suggest you an approach similar to the one explained here for the tesselation: http://www.gamasutra.com/features/20061221/dallaire_01.shtml
It works perfectly and is pretty fast. You can have a look to http://festini.device-zero.de/Programming/Downloads/index.xml where Alex Festini did a very good job implementing geomipapping in his terrain renderer.
Also it will all depends what you are planning to implement, i above assumed you'd be aiming for geomipmapping, however, some other methods such as geoclipmapping (http://research.microsoft.com/~hoppe/) or trilinear displacement mapping (http://users.belgacom.net/gc610902/technical.htm) might be more suitable for what you are planning to do and what are the graphic cards generation you are aiming too. On today's hardware for a immense world, geoclipmapping with displacement on GPU is working very well and to my mind is the best approach as you can find out on Hoppe's website and his nvidia paper. Only setback is you will need a different implementation on nvidia and on ati due to the vertex texture fetch/r2vb thingy...
Terrain system is a big word and there are a LOT of different ways of doing it depending what you are expecting.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.