Night is dark now

· Weather

I wanted the night to feel claustrophobic when you drive a unit, in first and third person: nothing past your line of sight, and the Prospector's light worth having because it pushes the dark back. Now past about 8 cells the land goes black, and anything a light falls on comes back out of it.

First person at midnight: the Prospector's drill and claw, a pool of headlamp light on the ground, the land beyond black against a starry sky
Midnight, first person, away from the base. The headlamp's pool is the only ground you see.

The sight

Round the unit you drive, the ground is clear out to about a third of your sight, then fades to opaque black at its edge. The sight is 8 cells through the evening and follows the giant's lit face, since its ringlight is what the night is lit by: 7.6 cells at midnight, 5 before dawn, and 0.6 of that in rain. By day nothing changes, and dusk and dawn blend between the two. It's only for the unit you drive; the top-down view is as it was.

The sky stays as it is. The giant, its ring, the stars and the clouds are all still there, and the land past your sight is a black silhouette against them.

Every light clears it

There's no list of lights. For each pixel, the shader compares how lit it is with what the sky alone would give it. At 1.25 times the sky's light the dark starts to lift, and at 8 times it's gone, smooth in between. So the headlamp's cone clears the ground with its own falloff as the gradient, and so do the buildings' lamps and windows, the pools of light on the aprons, other units' lamps, muzzle flashes, blasts, fires and a starfall's glow. Lamps, windows, beacons and running lights stay as they are, points in the dark, so you can see the way home from far off.

The Prospector's headlamp reaches 40 cells at night and still points at the crosshair: aim at the horizon and it lays a long pool down the ground, aim at your feet and you get a short one. The Mule got headlamps too, floods along its nose that reach 36 cells and glow as bright as its lamp bar.

In rain the wet ground's sheen would lift the dark on its own, so the thresholds go up with the rain and only a lamp clears it.

Before and after, the same frame

  • Side by side at midnight in front of the Citadel: before, the whole base visible in blue light; after, the Citadel a black mass with its lit windows, the giant behindMidnight at the Citadel, third person. Left the night before, right now: the walls go black, the windows and the doorway's lamps stay.
  • Side by side, first person facing the Citadel's door at midnight, the headlamp lighting the doorThe same in first person. The headlamp holds the door.
  • Side by side, first person on open ground at midnight: before, mesas and a wreck visible; after, only the headlamp's pool and the mesas' silhouettesOut on open ground. The mesas become silhouettes, and the pool is all the ground you get.
  • Side by side, third person on open ground at midnight, the Prospector's headlamp pool ahead of itThe same in third person.
  • Side by side, the Mule from behind at midnight, its new floods lighting the ground aheadThe Mule's new floods.
  • Side by side at the Citadel at 05:00, the giant low and faintBefore dawn, with the giant only 0.29 lit, the sight is down to 5 cells.
  • Side by side in rain at midnight, first person, the headlamp pool the only lit groundMidnight in rain: only a lamp clears it.

What it costs

Nothing I can measure. It runs in the pilot's veil, the pass that already draws the far haze round a driven unit: one more read of the surface's normal and about 30 instructions. With the dark on and off in turns, six times in one run at midnight, the frame moved by 0.09 ms on average, less than the turns differ from each other.

What isn't right yet

At the rim of a pool, where the light only just clears the dark, pebbles and their glints show before the sand between them, so the edge glitters when it should fade. The rain's streaks and splashes are drawn after the veil, so they stay visible over the black. And the land past the sight is pure black against the sky. That's my call to revisit: a dark tone, or no silhouettes at all.