Worlds
Every island is a number.
Continents come from five octaves of value noise; the mountain mask is a second field that
only bites where the base already rose, and the whole thing is multiplied by an island falloff
so the coast always drops into the sea. The same seed builds the same mountains on every machine,
in every browser — which is why the seed sits in the address bar, ready to send to someone.
Altitude decides the palette: sand at the tide line, grass on the gentle slopes, bare stone where
the cliff is too steep to hold soil, snow above the line. Trees and boulders are placed by the same
stream of deterministic noise, then merged into the very same geometry as the ground beneath them.
// one pass over the grid — hide what is shared
for (const f of FACES) {
if (solid(x + f.n[0], y + f.n[1], z + f.n[2])) continue;
for (let c = 0; c < 4; c++) {
const s1 = solid(base + sideA), s2 = solid(base + sideB);
ao = (s1 && s2) ? 0 : 3 - (s1 + s2 + corner);
pushColour(albedo * JITTER * AO_TABLE[ao]);
}
}
// 128 × 128 × 44 grid → 1 geometry, 1 draw call