Volumetric Lighting with Froxels

Where volumetric lighting comes from

As the graphical fidelity of video games has increased, the desire for photorealism has only gotten stronger and stronger. Nowadays games striving for photorealism make use of Physically-Based Rendering (PBR), modelling real-world phenomena like energy conservation, microfacet geometric detail and indirect illumination. As graphics hardware has gotten more and more powerful games have become capable of drawing more and more geometric detail with impressively realitic visual results.

However, in the real world lighting doesn’t exist in a vacuum - light interacts with particles found in the air, clouds and fog, which affects the light that refracts off of a surface before reaching the eye. For example, if you look at distant hills on a sunny day, you’ll notice that the colour of those hills blends more towards the colour of the sky based on how away they are from you.

View from the top of The Law in Dundee, where the land on the top right is much bluer than the land just across the river.
Image credit: https://www.dundee.com/activity/law

What’s happening here is that light is interacting with the particles in the atmosphere on its way from the hills to your eye. The further light has to travel to reach you, the more of the atmosphere it has to travel through and thus the more particles it has to interact with.

This is the case with other media made up of sparse particles, like clouds, fog and smoke.