3D terrain, tunnels and undersea air spaces

At present, all terrain in OpenSim is created using a 2D height map, as in Second Life™. Some time ago, I posted a blog post about the idea of using voxels, essentially a way of having a 3D grid of heights similar to 2D pixels. This has not been taken up or discussed anywhere else since but, I would argue, remains a serious issue in the usability of 3D worlds.

What can’t you do? Well, at present, you cannot make a seamless tunnel through land, i.e. you cannot have truly subterranean locations unless they are covered by prim land, rocks or other buildings. To do this, you would need a totally new type of height map, although it would perhaps be possible to write code to automatically upgrade existing height maps in much the same way as other database upgrades are made between OpenSim versions: essentially, the default for the upgrade would be for there to be no voxels beneath other voxels, i.e. no concavities. These could then be tunnelled later, which would require changes to both the server and viewer software. I admit, this is a LOT of re-engineering and unlikely to happen quickly.

Undersea locations would also be possible if sea voxels were marked as such, where no voxel marking sea height could be within a land space or above the maximum surface of the sea. This would enable air pockets under the sea, although excavating them upwards might be a tricky thing to make a viewer do in practice. At the moment, the manual land tools leave a lot to be desired anyway, but this seems like a thing that would be much harder to make work in a usable manner.

What about a temporary, easy workaround? In OpenSim, we love those! How about a tool to copy existing height maps into mega meshes with the same textures (and flat bottoms), that could then be exported, excavated horizontally as required and then put back in place of the existing height maps? The real height map would then be removed by flattening the terrain below the level of the mega mesh that had replaced it. It won’t fix the issue of undersea air pockets but it would make tunnels and caves possible above sea level, or undersea tunnels or caves flooded with water. Of course, as an after-thought, such meshes would also be usable in Second Life™ if they could be scaled to mega meshes without too much land impact. Any thoughts?

Voxels and meshes

Ever noticed you can’t create horizontal holes into a terrain height map with ground overhanging? That’s the reason why caves often need to be covered with large sculpted rocks or other prims to disguise them, which seldom works very well. At worst, you can’t have caves without an entire island made of sculpted prims. As a solution that relies entirely on circumventing the normal height map terrain model, this is at best a kludge. Height maps are 2D vertical models, which is why if you get too close to a mountain you can see that it’s only a skin. This simply detracts from the realism of the 3D metaverse.

Enter the 3D terrain map. I’m not an expert on meshes, but I wonder how they could be used on the scale required for terrain. On the other hand, I’ve recently seen this post on “voxels”, which is basically a 3D terrain map made of cubes similar to pixels, but naturally 3D. The jagged appearance of the terrain can be visually smoothed out, so essentially it would, if developed, enable overhangs and caves. It remains to be seen how resource intensive this would be. Height maps, while being very old technology, have the major advantage that they are very efficient in using resources. For most terrains that do not have sharp changes in elevation, they are fine – provided you don’t need caves or overhangs. But they don’t do mountainous terrain nearly as well.

My guess is that this will appear in an experimental form for OpenSim long before SL change their ageing terrain model.