# How do I connect the seams between my terrain?

I'm using c++ and D3D11 and I'm trying to create a (pretty) large terrain, lets say 4096x4096, maybe larger. I've got the basics of terrain creation and already split it up into chunks.

But, when I'm rendering them (every chunk has its own vertex and index buffer, as well as its own heightmap), there are still little pieces missing between them. I read a lot about LOD(Level Of Detail) and GMM(Geometry Mipmap), but I can't really implement the theory I read. At the moment, it looks like this:

I could really use some help, everything is welcome. If you have some good tutorials on any of this, please share them.

• Gnomgrol, welcome to GDSE. I've edited you question. No need to go so heavy on the acronyms, please let me know if I corrected any of them wrong. – MichaelHouse Jun 16 '12 at 17:55

You can check out my answer to a similar question here.

The part of the answer which is most pertinent to your question are these link; General Linking Page, Hugues Hoppe. In these links you should be able to find a technique similar to the one you are using and you should be able to use one of their solutions to the problem.

What you need to do here is create a vertex buffer to fill the gaps in the transition points between LOD levels. If you're system allows for the assumption that each chunk is half, equal or double the detail of the chunk next to it, it should be fairly simple.

Take this example for the transition zone of two chunks, one double the detail of the other;

1---2---3---4---5

6-------7-------8


You have these points defining the edges of one transition zone. You need to put these in a vertex buffer and create an index buffer which goes, 162, 627, 273, 374, 748, 485. Once you have a method to do this, you just need to repeat it for all transition zones.

Another way to do this is to interpolate another point half way between 6 and 7 and another between 7 and 8. This would allow both edges to have the same number of points making a vertex and index buffer trivial to create. It would also promote better use of the vertex cache since a triangle strip can be used instead of a triangle list. If you look at the index order in the example above you can see that 273 - 374 would stop you being able to use a triangle strip, but maybe you can find a better way of ordering them than me.