Bjartr wrote:So I had an interesting idea for using an advanced variation of heightmaps to create caves. Basically you have three terrain 'layers' to work with, one for each color channel in the heightmap. With a special value like 0 or -1 being that that layer does not exist at this pixel. I made the following image as a quick mockup of a really simple tunnel/cave.
I had a similar idea a few posts back, only it'd only take 2 channels to make a tunnel. (1 for the floor of the tunnel, 1 for the ceiling level)TheBigCheese wrote:This is just me thinking up crazy ideas about how it might be possible, but what about storing extra channels in the height map to represent tunnels? One channel could represent the height of bottom of the tunnel at that point, and another could represent the height of the tunnel at that point. Then it would be a matter of converting that into vertices, but it should be similar to the algorithm they use to get the mesh from the grayscale height map.
It'd look like this:
Normal Heightmap (Done in green layer as opposed to Alpha for clarity)
Red Layer: (The floor of the tunnel)
Blue Layer: (The Ceiling of the tunnel)
Combined:
Note that I don't know how to put the individual channels into grayscale images in GIMP, so they're colored by their channel.