Build — the shapes of the hillside.
Every function here returns flat-array geometry (or nil when it would be
empty). Nothing here touches the scene: `Hillside.component` uploads what
these return as runtime meshes and hangs them on entities. Keeping the
shapes in one place means the hill can be re-read, re-tuned and re-built
without going near the scene graph.
The camera stands uphill and above, looking DOWN the terraces toward the
valley, so the picture is made of treads seen from above, the parapet
stones standing along each terrace lip, and whatever grows on the soil.
The risers face away from that camera and toward the valley, which is
where the opening shot looks from — so they are built properly too.
tread(b: Mesh.Builder, row: number) → void
The hill itself: the treads, the parapets, the risers, the kerbs.
The worked surface of one terrace: the walking strip on its uphill edge
and the soil beyond it, both broken into a grid so the colour can drift.
| arg | type | description |
|---|
| b | Mesh.Builder | |
| row | number | |
contact(z: number) → number
Baked contact shade. Every tread has a wall rising at its uphill edge
and a parapet standing at its downhill one; a plane lit by one sun and
one ambient reads as a plane unless the corners are darker than the
middle, so the corners are painted darker.
| arg | type | description |
|---|
| z | number | |
h(ii: number, jj: number) → number
A hand's breadth of unevenness, so the ground is not a plane.
| arg | type | description |
|---|
| ii | number | |
| jj | number | |
wall(b: Mesh.Builder, row: number) → void
The dry-stone retaining wall under a terrace's downhill lip: courses of
laid stone facing the valley, and the parapet coping that stands proud of
the tread and gives the terrace its edge from above.
| arg | type | description |
|---|
| b | Mesh.Builder | |
| row | number | |
marks(b: Mesh.Builder) → void
Corner cairns at the ends of each wall, and a pair of stone posts either
side of the shrine terrace — the marks that say somebody built this.
| arg | type | description |
|---|
| b | Mesh.Builder | |
flankSurface(b: Mesh.Builder) → void
The mountainside the terraces are cut into. Without it the terraced strip
floats: the camera sees past its ends to the sky's ground colour, and the
hill reads as a model of a hill rather than a place on one.
| arg | type | description |
|---|
| b | Mesh.Builder | |
surface(x: number, z: number) → number
The height of the mountainside at a point: the terrace's own level
along the strip, falling away to either side and rising behind the
shrine into the slope the terraces were cut from.
| arg | type | description |
|---|
| x | number | |
| z | number | |
band(x0: number, x1: number, cols: number) → void
| arg | type | description |
|---|
| x0 | number | |
| x1 | number | |
| cols | number | |
flanks( ) → void
The mountainside either side of the terraces, as its own mesh. It is a
hundred metres across, so it is kept out of `hillside` — the shadow
cascades are fitted to whatever casts, and a hundred-metre caster spends
every texel of them on ground nobody is looking at.
hillside( ) → void
The terraces themselves: the treads, the dry-stone walls, the parapets and
the marks along them. Compact enough to shadow properly.
plotBed( ) → void
The plot: a tilled bed, and what grows on it.
One plot's worked bed: a square of turned soil with furrows drawn across
it. Built at the origin so a single mesh serves all thirty plots; the
material carries the state.
h(ii: number, jj: number) → number
| arg | type | description |
|---|
| ii | number | |
| jj | number | |
cropTuft(stage: number) → void
What stands on a sown plot. `stage` is 0..1 growth: a few short blades at
the bottom, a full tufted stand with grain heads at the top. The mesh is
built at the origin and scaled per plot, so three stages are three meshes
and every plot shares them.
| arg | type | description |
|---|
| stage | number | |
stubble( ) → void
What a burned plot leaves: charred stubble and a scatter of ash.
shrine( ) → void
The shrine — a small stone lantern-house on the top terrace, the thing at
the Facer's back and the thing the bloom must not reach.
The shrine, built about its own origin at the terrace floor.
shrineLamp( ) → void
The lamp inside the shrine — its own mesh so the world can drive its
emissive without touching the stone.
ridge(near: boolean) → void
Beyond the hill: the valley floor, the mist that fills it, and the ridge
the sun comes up over.
The far ridge, as two overlapping silhouettes so the valley has depth.
| arg | type | description |
|---|
| near | boolean | |
mistLayer(width: number, depth: number) → void
One layer of valley mist: a wide, soft card that fades at its ends.
| arg | type | description |
|---|
| width | number | |
| depth | number | |
valleyFloor( ) → void
The valley floor beyond the last terrace: cold, wet, low.
h(ii: number, jj: number) → number
The floor sits just above the slab the scene laid, stays flat while it
covers it, and then falls away into the distance.
| arg | type | description |
|---|
| ii | number | |
| jj | number | |