Voxel Terrain

A procedural voxel terrain generation demo based on marching cubes.

Imagem de capa

Code : Github

Date : Winter 2017

It’s a procedural terrain generation demo based on Perlin noise. The voxel representation is attained with marching cubes & marching tetrahedron.

Marching Cubes is one of the isosurface extraction algorithm, which was first published in the 1987 Siggraph proceedings by Lorensen and Cline. The application of this algorithm is mainly concerned with medical visualizations such as CT and MRI scan data, and special effects or 3D modeling with what is usually called metaballs. The two-dimensional method is called the marching squares algorithm. Anstroneer also uses this method to accomplish their stylized terrain.

As for the voxel, the signed distance field data representation and ray tracing or ray matching are usually the most accurate practice in volume rendering. However, although marching cubes is not really a volume algorithm, it’s more efficient for real-time application.

The procedural generation technique is mainly based on Perlin Noise, which is kind of general way to express self-similarity. The difference between this demo and Lowpoly Terrain is that this one can generate overhangs and cave.

I developed it for about 1 month, and the fps is basically over 60 but not steady because it’s based on CPU. I think it’s would be faster on a shader.

I see this demo as the foundation for my master research. Then I can execute the erosion algorithm on a 3d terrain.

The most troublesome part, I suppose, is to consider all the shapes that could happen inside a voxel cube, and thanks to there are some initial arrays can be download in the Internet.