Overview

This exploration of procedural terrain generation focuses on how to effectively create caves and overhangs with smooth terrain without producing floating artifacts. This technique leverages the qualities of perlin flow fields to create a smooth topology and utilizes marching cubes to render the resulting scalar field.


Challenge

I wanted to create a procedurally generated terrain that could support overhangs and caves. While 3D perlin noise could be layered on simple 2D noise to carve out caves, this creates artifacts and unnatural looking results. Transforming a simple plane also doesn’t work when overhangs and caves are involved.


Approach

The first problem to solve was the rendering. I utilized marching cubes to render a scalar field. In order to achieve overhangs and caves, the scalar field was generated by beginning with a simple density gradient from bottom to top. When rendered this would create a flat plane. By stretching this flat plane with flow fields we are able to sculpt all manner of features while maintaining a consistent topology.


Outcome

The system successfully generated overhangs and caves with smooth topology and no floating artifacts. This technique avoids a lot of common artifacts generated from traditional 3D noise without the need of costly algorithms to clean up the output. I explore marching cubes through compute shaders more here. Future development will focus on implementing data driven tools for designers to author terrains much like my previous terrain generator.