Camera that drives the level of detail.
ReadonlymaterialThe shared terrain material.
ReadonlyobjectRoot of all chunk meshes.
Resolved settings.
ReadonlystatsLive counters.
ReadonlyuniformsShader uniforms of the shared terrain material.
Brightness multiplier.
Bump strength.
Detail strength.
Detail fade distance, metres.
Detail noise scale.
Mud colour (linear).
Rock colour (linear).
Slope (rise/run) where bare rock takes over (synced from the world's ground.rockSlope).
Height band around sea level that is sand, metres (synced from ground.sandBand).
Sand colour (linear).
Saturation multiplier.
Snow colour (linear).
Temperature (°C) below which snow settles (synced from ground.snowTemperature).
ReadonlyworldThe world being rendered.
Frees all GPU resources, stops workers and detaches from the scene and world.
Replaces all settings; anything not given goes back to DEFAULT_TERRAIN.
Merges settings (nested material merges too). Geometry settings rebuild chunks; look settings apply instantly.
Moves the floating origin (planet-centred position that maps to render-space zero).
Picks chunks for the camera, schedules builds and swaps meshes. Call once per frame (done for you
when a scene was passed). budgetMs overrides buildBudget for main-thread builds.
StaticcreateCreates the terrain, starts workers and builds the first view so the first frame has ground.
Streaming level-of-detail terrain for a World: a grid of quadtrees on flat worlds, a cube-sphere of quadtrees on planets. Chunks split as the camera approaches (down to
minChunkSize), build in Web Workers or within a main-thread budget, never leave holes while they swap, and rebuild only the region a world change touched. Geometry is stored relative to each chunk's centre and placed relative to a floatingorigin, so it stays precise from orbit to ant scale.Example