Airlight is not a colour someone picked. It is the ambient light scattered into the line of sight along its path, accumulated over that path — which is why it appears in the equation weighted by rather than as an additive constant.
That gives it two properties an opacity knob does not have. It saturates: only a path long enough to be optically thick reaches the full ambient radiance . And it is a colour, inherited from the light in the scene — overcast daylight, sodium street lighting, a sunlit fog bank — so a fog render whose airlight is pure white has quietly asserted a specific and usually wrong illuminant.
Why thin fog must not inherit the full sky
-
The veil term on its own: the airlight actually accumulated by a ray of length d. It is the part of the fog equation that does not depend on the scene at all.
-
Expand for a short optical path. In thin fog over a scene a few tens of metres deep, the veil is linear in β and nowhere near the ambient radiance — the horizon simply has not had enough path to reach it.
-
The pipeline cannot integrate that per scene, so it applies a monotone dampening factor to the estimated airlight instead — a stand-in for the saturation above that needs only β.
-
The shape a figure should be able to assert: full ambient brightness in clear air, exactly halfway at the reference β (80 m visibility) with strength 1, and a floor it approaches but never reaches. Note that it is applied to estimated airlight only — a colour an author typed is left exact.
Then there is the sky, which has no depth at all. Nothing in a sky pixel is at a finite range, so has nothing to evaluate — and leaving those pixels at the far clip renders a sky of uniform airlight with a hard line where the geometry ends.
The fix is geometric rather than cosmetic. Treat the fog as a layer of finite height, build the ray direction for the pixel from , take the camera's up-vector from its pitch and roll, and use the length of that ray's segment inside the layer as . Rays that climb steeply leave the layer quickly and get a short path; rays near the horizon stay inside it and are capped. The sky gradient is then a consequence of the geometry instead of a texture.
You render fog with the from-sky estimator on a frame that has no sky in it — a tunnel approach, or a camera pitched at the road. What comes out?
Show answer
A white airlight, and therefore a whiteout. With no sky pixels to average, the estimator falls back to white, and the render composites toward pure white rather than toward the actual ambient colour, which in a tunnel approach is dim and strongly tinted. The dampening factor does not save it: dampening scales a colour's brightness, so it makes a wrong colour darker rather than making it right. Either supply a mask that covers the real ambient source, use the heuristic estimator, or set the airlight explicitly — in which case, note that the dampening no longer applies at all by default.