Prefer Scatter.create, which also builds all tiles up front.
Camera the tiles follow. Can be swapped at any time.
ReadonlyobjectRoot of all pooled meshes. Added to scene for you when one is passed to Scatter.create.
Terrain height at world (x, z); NaN where there is no terrain.
Resolved settings. Read-only: change them with Scatter.set / Scatter.reset.
ReadonlystatsLive counters, refreshed on every Scatter.update.
Removes the scatter from the scene and drops its pools (reclaimed by GC, see retire). Layer geometries and materials are yours to dispose.
Instances within radius of world (x, z), for gameplay and collision. Deterministic: tiles that are not streamed
in are generated on the fly (not cached), so results don't depend on where the camera is.
Throws away all generated tiles; they are rebuilt (within the build budget) over the next frames.
Replaces all settings with input; anything not given falls back to its default. <Scatter> uses this.
Changes settings, merging into what was set before (layers is replaced as a whole). Only what changed is
redone: placement changes regenerate the affected layer groups, LOD/material changes only rebuild the pools.
Density functions are read when a tile is generated; call Scatter.regenerate after changing what one returns.
Swaps the terrain (mesh or height function) and regenerates every tile.
Optionalterrain: TerrainStreams tiles in and out around the camera, generates pending ones within the budget and, when the camera has
moved far enough or tiles changed, re-sorts instances into levels of detail. Called automatically when a scene
was given (and by <Scatter>); otherwise call it once per frame.
Milliseconds for tile generation this frame. Defaults to settings.buildBudget.
StaticcreateCreates a scatter and generates every tile in range, so the first frame is complete.
Streams instanced objects (trees, rocks, shrubs…) over terrain in camera-centred tiles.
Each tile places every layer with seamless blue noise (see
poissonDisk), filtered by density, slope, height and clumping noise, so the world is a pure function ofseedand position. Instances of each layer and level of detail are pooled into one instanced mesh, so draw calls don't grow with the number of tiles.Example