← labopen mistwood →

Mistwood

A walk through a seeded wood in fog. Started 30 September 2026 from a photograph: a green-grey woodland fog, a small bare tree leaning over dry grass, tall trunks fading behind, a birch, a beech sapling keeping last year's leaves.

Nothing to do and nothing to finish. Touch the ground (below the horizon) to walk, at once; the finger is a tiller (held right of the middle you keep bearing right, the further out the sharper; the middle goes straight), so you never need to lift and drag again; the pace builds from a walk (2.4 m/s) to a brisk one (4) and, if you keep on, a run (7.6) (where the device reports real pressure, e.g. Apple Pencil, pressing harder goes faster). Touch the sky to look: across turns you, with a head's weight; up and down cranes your neck, harder the further it goes, and eases back level when you let go. Two fingers pinch to look closer (up to 4×), easing back out. Standing still is still.

The approach: silhouettes, in extreme detail, on the GPU

In mist only the outline reads, so everything goes into the outline, and the realism is carried by the fog and the light rather than by geometry.

Paths, light, species, deer

Places (client/world.ts place)

The wood is not the same everywhere. The ground rises and falls: gentle relief, computed identically in JS (groundH) and in the shaders, so trees, deer and your eye stand on it. The world shader marches each ray to the ground, never stepping further than the slope allows. What the relief makes of each place:

Each species keeps to the places that suit it (AFFINITY). Tall trees keep to dry shelter. Leaners lean towards the wet. Birch takes the open and disturbed ground. The fog is a little thicker in the hollows. Slopes facing the light are a little brighter.

Undergrowth, and the grade

The open wood stands in a knee- to waist-high mass of dead growth. In the reference photograph (devtools/reference/misty-woodland-edge.jpg) it fills the bottom third, and its ragged top melts into the mist, so no ground plane or horizon line ever shows.

Stone (structuresNear in world.ts, traceStructures in render.ts)

Monolithic structures stand in the wood, seeded like everything else:

How they are made and drawn:

The small voices (client/audio.ts creatures)

All synthesised:

Deer (client/deer.ts)

Each wood has its herds of two to five deer. About half of the 120 m squares hold one, with a home range around a lying-up place in cover, off the paths. Herds come into being as you come near their range and are let go when you are far, so they are there again when you come back.

The journey in the address

The wood is fully seeded. Every tree, tuft, log, pond and herd's home comes from the seed and the place alone (Math.random only picks a fresh seed and voices the sounds). Where you are is kept in the address as you walk, about once a second when it changes:

So a reload, or a shared link, goes on from exactly there.

The other way round works too, without reloading. Setting x, y or heading (from the overlay, or from a test in the same page through window.__flags.setFlags({ x, y, heading })) moves you there at once. Setting seed makes another wood. So a walk can be stepped through and photographed in one page session:

  1. Set the place.
  2. Wait for __mistwood.settled, which means everything in view is grown and baked as sharp as it is wanted.
  3. Take the screenshot.

Add hour, time and fixed for the same light, wind and resolution each time.

What is not replayed: the deer's moment-to-moment wandering. Their herds and homes are seeded, but where they have got to depends on how you came.

One seed, one wood

The seed is in the address (?seed=moss-ford-7) and at the foot of the screen; touch it for another wood. Nothing is stored: any stretch of the wood is placed the same again from (seed, chunk). Trees come from a pool per seed (about forty, each unique), placed again at different sizes and mirrored.

Budgets

Cards are kept within about 64 MB (least recently used go first; if everything in view is in use, every card asks for fewer pixels until it fits). Resolution drops by itself if frames are slow, and climbs back after a few seconds of quick ones; time spent on another tab is not counted as a slow frame (?fixed keeps it). A card that isn't baked yet from this side borrows the nearest side that is, so no tree is ever missing.

Near trees go live within 16 m, nearest first, and those already live keep their place ahead of newcomers. Short of budget, a tree draws fewer of its segments (thickest first) rather than dropping to a card. In the handover the live tree fades in over its card, then the card fades out beneath it, so coverage never dips. Live trees lay down depth for their solid wood first, so twigs behind a trunk are hidden. The fog's thickness belongs to the place (hollows where it lies thick), not to how far you have walked. A new seed frees every GPU buffer of the old wood.

Sound (client/audio.ts)

Synthesised: wind in the trees, a far bird call now and then, and your steps.

Devtools (devtools/, not synced to the cell)

harness.mjs builds the client, serves it the way the cell does, and drives headless Chromium through the flags. The other tools are built on it:

Output goes to devtools/out/, which git ignores.

Flags and the tuning overlay

Every flag in the address is declared once, in client/flags.ts, with:

Code reads flags only through flag('name'). An undeclared name does not compile, and an out-of-range or unknown value is refused with a warning.

Current flags: