Game dev
Saved & recent

Volumetric lighting

Related terms: god rays, light shafts, volumetric fog, volumetric sky

Makes light visible in the air itself, like sunbeams through a dusty window. Normal lighting only colors surfaces. Volumetric lighting also accounts for the haze between the camera and the surface.

The renderer steps along each view ray and adds up how much light the air scatters toward the camera. It is costly, so it is usually computed at low resolution and blurred.

Further reading
Epic Games: volumetric fog
window sunlit floor light shaft lit sample camera
Left, lighting only on surfaces: sunlight colors the floor it reaches. Right, with volumetric lighting: the sunlit air also scatters light toward the viewer, and each shaft is brighter where a line of sight crosses more of it. The camera's view ray is marched in equal steps; filled samples lie in sunlight and add to its pixel, open ones lie in shadow. The haze is uniform and scatters light once.

View in the full Game dev collection