Three kinds of light
This session started with a question: does RACTR have ray-traced lighting? The answer turned out to be the best kind of surprising — this engine has been a ray tracer since the day it was born, because every pixel is already a ray traced through the density field. What it was missing wasn't ray tracing. It was three specific kinds of rays. By the end of the night the moon cast shadows, dawn light broke into beams between the trees, and campfires burned in the wilderness — the first light sources in this world that aren't in the sky.
The question, answered honestly
Hardware ray tracing — the RTX kind — is a machine for firing rays at triangles. It builds a tree of bounding boxes around a mesh and lets silicon walk it fast. RACTR has no triangles. The whole world is one continuous field, and the renderer finds surfaces by walking rays through that field directly — which is ray tracing, done in software, against real physics instead of a bag of polygons. Bolting a triangle accelerator onto an engine with no triangles would accelerate nothing. And it wouldn't run anyway: the graphics layer RACTR ships on exposes hardware ray queries on exactly none of our targets — not on the Mac's Metal backend, not in any browser. So the answer to "should we add ray tracing" was: we already did, the day the engine was born. The real question was which rays are missing. Three were.
First light: the moon learns to cast shadows
An audit of the lighting pipeline turned up something embarrassing for a game whose nights matter this much: moonlight ignored the world. Sunlight has always paid for a real shadow ray — traced toward the sun through the same field the geometry renders from. Moonlight was just a dot product. A moonlit forest at midnight had zero shadows: every clearing, every tree, lit by the moon as if the trees weren't there.
The fix is almost free by construction. At night the sun is below the horizon, so the sun's shadow work never runs — the frame's shadow budget was sitting idle exactly when the moon needed it. Now the shadows follow whichever light owns the sky: sun by day, moon by night. The bench actually came back faster than before, because the same pass also improved soft shadows — sharp where an object touches the ground, softer with distance. The first cut of that painted the entire noon foreground black, and it was caught the same hour by the standing rule that every shader change gets before-and-after screenshots at three times of day.
Second light: the beams
Sunbeams through trees — god rays, the film-school word is crepuscular rays — were never going to come from the fog system. The atmosphere in this engine already scatters sunlight along every camera ray; that's why distant hills go blue and dawn goes gold. But it scatters as if the sun reaches every parcel of air unobstructed. Under a forest canopy that's exactly wrong: the air in a crown's shadow should lose its golden glow, and the bright shafts you see in a real forest are just the gaps.
So the new pass doesn't add light at all. It works out where the sun really reaches the air in front of you, and takes away the glow the atmosphere overcounted where it doesn't. Beams emerge as the untouched bright gaps between dimmed wedges. Open ground is unchanged — no double halo, nothing to wash out. Two failures made it shippable. The first cut was gorgeous and cost most of a frame. The rescue made the same beams nearly free. The second failure carved razor-edged black wedges across the sky, because it took away more light than the air ever had. Shadowed air still glows — the whole sky lights it — and once the pass respected that, the wedges softened into weather.
Third light: fire
Here is a fact about RACTR that was true yesterday and is false today: the sun and the moon were the only lights in the entire world. Every camp, every city window, every night encounter — lit exclusively from the sky. No torch, no lantern, no campfire has ever cast light on anything.
The camps got their fires tonight. Each of the world's camps now carries a fire pit at its centre stone; walk within range at night and there's a warm pool of light over the grass, flickering, with the camp's inhabitants silhouetted around it. The engine carries several nearby fires at once, and when there are none it costs nothing measurable.
The honest failure, because there's always one: the first build's firelight was invisible. Every plausible suspect was innocent; the data was perfect and the photometry was wrong. A light sitting at ground level grazes flat ground, so the physics correctly delivered almost nothing. Real campfires light the ground because flames stand half a metre tall. Lift the light to flame height, let it wrap the way scattered firelight does, give it the strength real fire has, and the pool appears.
Engine v0.22.79 → v0.22.81, live now in the browser at ractr.com/play — the moon shadows, penumbras, and god rays run identically there; the fires arrive in the browser when camps do. Suite green throughout: 76 tests, 4 physics gates, and the frame budget ends the night roughly where it started — three lighting features for a net couple tenths of a millisecond. The lesson of the stretch: in a field engine, "add ray tracing" means "decide which rays you owe the world" — and the cheapest ray is the one whose budget the frame was already paying.