Terrain Architecture
The terrain system demonstrates a complete Layer 3 module implementation with chunking, erosion simulation, and level-of-detail management.
Chunking
The world is divided into fixed-size chunks for efficient loading and persistence. Each chunk is an entity with terrain components.
constexpr uint32_t TERRAIN_CHUNK_SIZE = 64;
constexpr uint32_t TERRAIN_MAX_HEIGHT = 4096;
Erosion
Hydraulic erosion is simulated per-chunk using particle-based flow algorithms. Water particles trace paths downhill, eroding and depositing sediment.
Erosion runs as a Plugin (Layer 4), keeping the core terrain module independent of the simulation method.