five-on-it / apps/client/src/renderer/actor-lamps
apps/client/src/renderer/actor-lamps
The street lamps' light on the cars and the people (GAME_DESIGN §5.7), with a GPU: a car or a person passing under a lit lamp is lit by it, one in the dark is not. A fixed pool of ACTOR_LAMPS.count point lights, made once when the level loads (a light made or switched off later would build every shader again) and switched by their intensity, stands at the heads of the lit lamps nearest to where the camera looks. They light the actors' meshes alone (draw.ts's ACTOR_LAYER): the level's own shaders never count them, and the level is lit by the pools drawn on its ground (night-view.ts). A light's strength falls to nothing as its lamp becomes the farthest of those lit, so a light moving on to the next lamp is never seen.