five-on-it / apps/client/src/renderer/night-view
apps/client/src/renderer/night-view
The city at night (GAME_DESIGN §5.7), lit as it gets dark (daylight.ts's dark):
- Street lamps (
@foi/world'slampsOf): a pool of light on the ground round every lit lamp's foot and a halo at its head, thin instances of one disc. A lamp knocked down (its light piece lying loose) is out: no pool, no halo, its head as dark as the rest of it, until a level reset plants it again. The AI sees by the same lamps (@foi/ai'svisibility.ts). - Windows (
window-lights.ts): a share of them lit by the hour, each in its tone, the ground floors' throwing their light on the pavement. The glass itself (the kits'glass,glass-light,windowcolours) only catches a faint sheen; dark glass stays dark. - Cars (
car-lights.ts): every car that somebody drives throws its headlights on the road ahead and a red glow behind. The player's own also has a real spotlight with a GPU, which lights the walls and the people ahead. - Under the lamps (
actor-lamps.ts, with a GPU): the cars and the people passing under a lit lamp are lit by it.
All of it is a handful of draw calls whose colours are added to the picture, and none of it is drawn or worked out by day.