landform
Authored landforms as terrain overrides — where slope-profiles remap
the noise (levels curves), a landform forces a shape through it: a volcano
cone, an impact crater, wherever you say. Pure, deterministic, unit-tested;
b3d-terrain applies its landform hook after the profile pipeline in
origin-stable coordinates, so authored shapes survive floating-origin resets
and light correctly (normals difference the hooked field).
The factories return a matched pair — the height landform and the
provinceField that makes it glow — because a volcano isn't a shape OR a
material, it's both:
const vesuvius = volcano({ x: 45, z: -25, radius: 55, height: 24, baseLevel: 5 })
terrain.landform = vesuvius.landform
terrain.provinceField = vesuvius.province
terrain.regenerate()
Shown, not run — it needs a
terrainfrom the surrounding scene. The doc system executes```js,```tsand```tjsfences as LIVE examples, so an illustrative fragment in one of those renders as a broken demo.```javascriptis the fence for "read this, don't run it". A working landform is on the sdf-lattice page, wherevolcanobuilds the cone you can cut open.
And a runtime explosion is the same move with the other factory — stamp an
impactCrater at the hit point, compose it in, regenerate(): a glowing
crater with almost no effort. pad is the same idea for CIVILIZATION — a
dead-flat surface with a cut-and-fill skirt, which is how cities and bases
claim ground (terrace several up a hillside with composeLandforms).
composeLandforms chains shapes; mergeProvinces maxes glow fields.