Dynamic 2D lighting transforms flat game scenes into atmospheric environments. Each point light has position, color, radius, and intensity. Brightness at any pixel uses inverse-distance falloff with smoothstep for clean fade-out. Multiple lights combine through additive blending, creating bright intersections where they overlap. One light follows the mouse, simulating a player-carried torch.
Key Concepts
point light falloff
additive blending
ambient light
interactive mouse light
Try this shader live in the Shader Sandbox editor with real-time preview.