A toy procedural cave generator. Made for PROCJAM 2024 in just a few days.
Generates small, stylized caves.

Use arrow keys to look around, WASD to move, spacebar to ascend, and shift to descend. 
Press N to generate a new cave.

This is very much a work in progress.
Note: There is a bug where sometimes you start off looking straight at the floor.


How it works:

  1. Generates a basic cave shape with a method similar to Perlin Worms
  2. Construct a signed distance function (SDF) from the basic cave shape. Combine multiple shapes using a smooth minimum function
  3. Warp the SDF using layers of Simplex and Worley noise
  4. Split the scene into chunks. Discard chunks if they are a sufficient distance away from the nearest terrain surface
  5. Sample the SDF in a grid for each chunk. If every sample is considered inside or outside the terrain, discard that chunk
  6. Construct the terrain mesh for each chunk using Marching Cubes
  7. Calculate vertex normals using the gradient of the SDF
  8. Render the terrain using triplanar mapping
Updated 14 days ago
Published 16 days ago
StatusPrototype
PlatformsHTML5
Rating
Rated 5.0 out of 5 stars
(2 total ratings)
AuthorQuintin
Made withUnity
TagsExperimental, Exploration, Generator, Procedural Generation, PROCJAM

Comments

Log in with itch.io to leave a comment.

(+1)

This is really impressive!