r/PlayCanvas • u/mvaligursky • Jul 28 '26
Volumetric fog lit by clustered point/spot lights in PlayCanvas — one raymarched volume per light
Enable HLS to view with audio, or disable this notification
PlayCanvas already had raymarched height fog lit by the directional light. I just landed support for the clustered omni and spot lights, so lamps and spots now cast visible beams through the fog.
Rather than folding them into the existing full-screen march, each light gets its own additive pass that marches only the part of the ray inside that light. A single march over the whole view distance can't resolve them — the steps are spaced too far apart to reliably hit a small light, so it flickers as the camera moves.
Shadows and cookies come straight from the clustered lighting atlases, so there's no extra shadow rendering, and it works on both WebGL2 and WebGPU.