Question about workings of terrain


I’m working on a never ending terrain which develops itself as it goes. To do this I have multiple small terrainmaps (9). As one goes, terrainmaps are deleted and created. I have a poblem with this however.

For every 65x65 terrain, I have a 2d float array. To “stitch” the maps together, I pick the outer edges of the map and pass them on to the map next to it (actually the other way around).

However, maps never align properly. I tried different coding but no luck. It works though when all edges are 0, but doesnt look all that nice.

I’m wondering if it is because of the way the terrainquad etc is constructed.

Any help/suggestions would be awesome.

Are you trying to get the terrain to match up with different levels of detail?

TerrainQuads seam themselves together automatically based on their neighbour’s LOD level. You could extend the TerrainQuads to have neighbours beyond what is in the current quad tree. You would mostly just have to modify the getRightQuad, getTopQuad, getLeftQuad etc. and getRightPatch, getLeftPatch etc. methods to look at neighbouring terrain quad trees.

For “never ending”, make sure you account for float precision at far distances. @dpwhittaker made a terrain system called Monkey Horizons, it is quite good and allows for nearly infinite terrain. Here is a thread on it:

Thanks for the informative post, Sploreg. I tried Monkey Horizons, because I thought it was nice judging from the video and probably better than my “infinite world”, however it gave me “Cannot render mesh without shader bound”. Any idea what the source of that could be?

That error means the mesh has no material applied to it.

Maybe send a message to @dpwhittaker and see if he knows what might be wrong with the source.