Log inGet started
World

Verdigris Cloister

Branchmain
Branchesmain
Commit65770846aa

README.md

game/env — the Verdigris Cloister

The place the game happens in: a derelict monastery greenhouse at the end of the world. A stone nave twenty-two metres across and eighty long, brass ribs vaulting to a ridge twenty-six metres up, a cracked glass roof, irrigation pipes weeping verdigris down every pier, and shafts of sun coming through the holes in the glass to land in pools on the wet floor.

This slice also owns the lighting and the post-process chain for the whole game, because the look of the room and the look of the image are one decision.

Putting it in a scene

entity.spawn("Cloister", { parent = entity.find("Greenhouse") })
    .component.add("Cloister", {})

That is the whole interface. Cloister raises everything on awake(). Its ownsLighting / ownsPost / ownsSky fields say whether it also sets the sun and ambient, the post chain, and the sky — all on by default.

What is here

PathWhat it is
greenhouse.module/the builder: geometry, materials, light, post. Env.build(root) / Env.clear(root) / Env.light(root) / Env.post() / Env.sky()
Cloister.component/the component that calls it at scene load
shaders/six .shader assets — stone, brass, glass, light shaft, glow, spores, and the cloister_haze post pass
materials/the fourteen materials those shaders wear

Everything the module makes is named env_* under the entity it is given, and every build clears the previous env_* first, so it is safe to raise the room as often as you like. That is the authoring loop: edit greenhouse.module, re-add the component, capture, look.

Two things worth knowing before changing it

Nothing here ticks. There is no update(), no task, no driver loop. The drift in the spores, the boil of dust in the shafts and the crawl of the vapour are functions of time evaluated on the GPU, so the room costs one frame at load and nothing afterwards. Keep it that way: this game has no clock in it anywhere.

Every mesh is built about its own centroid and its entity is placed there, rather than baking world coordinates into the vertices. A Model whose geometry sits a long way from its entity's transform renders correctly and casts no shadow at all, and the vault holding the sun off the floor is the whole reason the room reads — see the note above ribMesh.

The light, and why the roof is opaque

The sun comes down the nave at (0.22, -0.94, 0.26). Env.SHAFTS lists where the roof has lost its panes, and that one table is read three times: the roof is built with those panes missing, a cone of light falls from each hole, and a warm point light sits where that cone reaches the stone. The landing points were chosen by working backwards — two of them on the board itself, one just off each side, the rest running away down the nave.

The roof glass is an opaque material. A transparent one never reaches the shadow depth map, so a see-through roof lights the whole floor evenly and the holes in it mean nothing at all. Opaque, the vault holds the sun off the stone and the only light on the floor is light that came through a hole, which is the image this room exists to make.

The frame

Env.post() assembles the chain and states the order as priority:

prioritypasswhy there
10cloister_hazedistance + height fog, in scene-referred light
100bloomon top of the fog, so hazed light blooms
150color_correctionthe grade
200tonemap (ACES)lands it in the display
300vignettelast

A chain assembled twice by two slices is a chain nobody can reason about, so if another slice needs an effect it should add it here rather than beside it.