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.
- Godot 4.6 (Mono build)
- .NET / Mono runtime supporting .NET 8
- Vulkan-capable GPU with compute shader support
- Open the project folder ./godot in the Godot editor. Allow the editor to build the C# assemblies.
- Open the main scene ./godot/main.tscn (it should open by default).
- Navigate the scene tree under the
Cavenode. You can edit parameters in the Godot editor, then click the "Generate Cave" button in the Inspector of theCavenode. - You can press the "Run Project" (it is the little "play" arrow) button at the top of the editor to explore the cave!
Pipeline stages:
- Layout: stochastic L-system generates a tree-like graph; macros and branching rules control topology. The code for this is in ./godot/Layout.
- 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.
- 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.
- L-system rule set and stochastic choices: see the
Layoutnode. - Turtle: step length, pitch/yaw increments, branching probability. Also in the
Layoutnode. - Voxel grid: resolution and world bounds (primary tradeoff: quality vs.
time/memory). In the
Voxelsnode. - Brush: radius, falloff, noise amplitude. The default brush is
NoisyBrushwhich gives the most organic results. You can replace it withSmoothBrushorSphereBrushby setting the field "Brush" in the Inspector of theCavenode.
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