So, I have a server, I use routines on the server side to generate a heightmap for the whole of my world in one shot (lets say 4096x4096). This allows me to not worry about having to raise and lower terrain when stiching terrain blocks together.
I then write a routine to split my generated height map into 128x128 blocks so they are of a size I can send to a client app in pieces (sending all blocks adjacent to the client location every time he moves from block to block).
On the jMonkey client when I load in the game character it pulls in all adjacents 128x128 terrain blocks and attaches them to the root node each as an individual terrain quad. Everything working fine so far.
The one problem though. Each terrain block is obviously not stitiched to the adjacent terrain block creating a gap (one heightmap point in width) between each 128x128 slab. Now I obviously need to eliminate the gaps somehow and would appreciate opinions from people more experienced with terrain than myself (this is my first outing). The way I see it I have the following options:-
- Alter the TerrainQuad in some way to stitch between blocks using terrain splating somehow - not even sure this is possible and have no idea how to do it as it will probably involve implementing #2 below to get the terrain splat to work.
- Take the current 128x128 heightmaps and extend each of them 1 point to the x and z axis with the exact same vertices as the terrain block they are stitching too. Is this the normal methodology for stitching something? Do graphics cards have any performance problems with rendering against vertices that are connected to 2 different meshes and have the same vector? - as you can see my low level knowledge of resolving the problem isn’t the best at present.
- My least favourite solution, load a massive amount of terrain into the client in a single block and when they move close to being able to see the edge of the terrain, remove the terrainquad node containing the large amount of terrain and add a new one centering on where the game character is at the time. This one is my final option as it will more than double the amount of memory taken up by the client for heightmaps, not to mention maybe causing the client render to stutter.
Anyway, thoughts welcome from anyone. Or maybe I am missing some basic functionality of TerraMonkey and someone can point me in the right direction.
Thanks
Physi