geom
A small mesh builder. The fen is five hundred deck planks, eighty piles and forty thousand reed blades, so it is accumulated into flat vertex streams here and uploaded as a handful of merged runtime meshes rather than being an entity per plank.
fen.geom
A small mesh builder. The fen is five hundred deck planks, eighty piles and forty thousand reed blades, so it is accumulated into flat vertex streams here and uploaded as a handful of merged runtime meshes rather than being an entity per plank.
Every vertex carries a colour, and the pbr shader multiplies base colour by
it — that is what carries the weathering (a plank's sodden end, the pale crown
of a reed, the tar at a pile's waterline) with no textures at all.
local Geom = require("fen.geom")
local b = Geom.builder()
Geom.box(b, centre, half, colour, { up = …, topColor = …, topScale = … })
Geom.prism(b, base, axis, r0, r1, sides, colBottom, colTop, capBottom)
Geom.blade(b, root, height, width, leanX, leanZ, yaw, colRoot, colTip, segments)
local mesh = Geom.upload(b) -- a MeshHandle a Model can wear
Geom.rng(seed) is a deterministic little PRNG: the fen has to come up the
same every boot, on every machine, or it is not a place.
half is a HALF-extent. Writing a length there gives you a shape twice the
size you meant, which at this game's grazing camera angle is the difference
between a floating plank and a dark shard across the frame.
Scoped to this part · feeds back into the world's score.