Skip to content

elisesouche/cavegen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Procedural Cave Generation

Procedural game-oriented cave geometry. Goals are aesthetics and fun; this is not intended as a geological simulation.

It runs in the Godot game engine.

Repository is on GitHub :( For more details, check the report.

Requirements

  • Godot 4.6 (Mono build)
  • .NET / Mono runtime supporting .NET 8
  • Vulkan-capable GPU with compute shader support

Usage

  1. Open the project folder ./godot in the Godot editor. Allow the editor to build the C# assemblies.
  2. Open the main scene ./godot/main.tscn (it should open by default).
  3. Navigate the scene tree under the Cave node. You can edit parameters in the Godot editor, then click the "Generate Cave" button in the Inspector of the Cave node.
  4. You can press the "Run Project" (it is the little "play" arrow) button at the top of the editor to explore the cave!

Architecture

Pipeline stages:

  1. Layout: stochastic L-system generates a tree-like graph; macros and branching rules control topology. The code for this is in ./godot/Layout.
  2. Volume: layout samples are applied to a voxel scalar field via metaball-like brushes (smooth falloff, optional noise). The code for this is ./godot/Voxel.
  3. Surface extraction & render: isosurface (density = 0) extracted with Marching Cubes running as a compute shader. The code is in ./godot/Mesh. The mesh is rendered with a PBR shader with triplanar mapping.

Generation parameters

  • L-system rule set and stochastic choices: see the Layout node.
  • Turtle: step length, pitch/yaw increments, branching probability. Also in the Layout node.
  • Voxel grid: resolution and world bounds (primary tradeoff: quality vs. time/memory). In the Voxels node.
  • Brush: radius, falloff, noise amplitude. The default brush is NoisyBrush which gives the most organic results. You can replace it with SmoothBrush or SphereBrush by setting the field "Brush" in the Inspector of the Cave node.

Performance and limitations

Brush application is the main computational bottleneck; generation time increases with voxel count. With the default parameters, complete cave generation take a few minutes on my laptop.

Author: Élise Souche, ENS de Lyon. License: GPL-3.0-or-later

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors