five-on-it / apps/client/src/renderer/effects
apps/client/src/renderer/effects
Short-lived effects: gunshots (a muzzle flash, and a tracer streak per bullet or pellet flying from the muzzle to the impact, tracers.ts), a punch's swing (a short white fan of lines that fades in a tenth of a second), blasts (a wire sphere that swells to the blast radius and fades), blood (a burst of mist that follows the person hit, drops that fall and the stains they leave, blood.ts), sparks (a burst of hot shards where a shot hit a car or a wall), tyre smoke and dust (flat-shaded puffs that swell and shrink away: light grey off paved ground, dust-coloured off loose ground; a ring of dust where a car lands), a wreck's smoke (dark puffs that rise high, billow out and drift with the wind for seconds, wreck-smoke.ts keeps them coming) and the tyre marks (marks.ts, one mesh lifted MARK_LIFT over the road, above its paint).
The puffs, the plumes, the sparks, the mist, the drops and the muzzle flashes are pools of thin instances, one mesh and one draw call each; the tracers are one mesh of streaks and the swings one of lines, whose colours carry their fade; the marks and the stains one mesh each; the blasts a pool of spheres made once and reused. Nothing is created or compiled while the game runs, and every pool and the marks have a cap, so a firefight costs no more than its caps and the frame rate holds on a software renderer. Nothing here touches the simulation.