scatter
Where things grow: rocks and trees placed on terrain by budget and by
climate. The function is scatterPlacements (a bare scatter would leak a
common noun from the barrel, and one demo already has its own). Pure, with no Babylon and no DOM; the terrain and its climate
arrive as functions. b3d-decorator draws what this
returns.
The rules speak climate, not biome names
A rule says where its kind is SUITABLE, in the same axes the terrain's biome shader classifies by (biome-chart): temperature and moisture (0…1 chart units), altitude above sea level (m) and slope (degrees). So the trees agree with the ground colour by construction: pines where the shader paints cold forest, palms at a warm shoreline, cacti in hot dry country, and bare rock on the steep and high.
Each axis is a soft band ([lo, hi], eased over soft), and a rule's
suitability at a point is the product of its bands times its density.
Budget, not density
budget is the number of things, which is what performance cares about.
Candidate points are laid down at oversample × budget, the rules score each
one, and an acceptance threshold is SOLVED so the expected count equals the
budget. Sparse country and lush country get the same count; the lush one
spends it on trees.
World-anchored and deterministic
Candidates live in world cells: each cell's point is a hash of its integer coordinates and the seed. The same place always gets the same answer, however the region moves, so re-scattering around a moving camera changes what is at the EDGE and nothing that stays in view. Stable is the point.