I’ve been working on projects to create various sorts of randomly generating terrain, messing around with things such as perlin noise etc. I’m now wanting to try to make some procedural generated planets. I’ve done some research and the main method seems to make 6 square heightmaps using algorithms such as perlin noise, making a cube with these 6 heightmaps and modifying the mesh to make a sphere, as shown:
The obvious problem with this method is that the edge of each heightmap has to be seamless with one edge of each of the 4 heightmap it’s connected with, and I have absolutely no insight on how to do this. Does anyone have any advice/ideas/suggestions/useful links about the solution?
Cheers.
This depends on how you’re storing your information and whether or not you’re doing real time height updates (players being able to paint terrain etc). In a real time situation you’ll want to have some some memory mapped grids for the heights in which the edges are linked and trigger the same updates across the mesh.
If the height-maps are prepossessed simply filter them and average the values at the edges. To attain a more natural look blend all values near edges (a convolution kernel would work well here) then apply a little bit of noise on top of that.
Thanks a lot for the answer.
I’m not looking at doing real time height updates. I was almost hoping there was some trick I was missing but your answer makes sense.
An alternative would be to do some kind of UV mapping of a single noise texture onto the six faces but you’re still going to have to content with some UV seams or pinching at the poles.
I’ve realised that I can generate my terrain in the form of the net of a cube, ie;
This would mean that when I make the cube with the terrain, 5 of the 12 edges between cubes would already be seamless, since they were generated together. This isn’t a perfect solution but it helps the problem.
Again if anyone’s got any more ideas, please do post.