No jobs
Core 11 min 2 of 5

Airlight is an estimate

A is scattered light with a path length behind it, an estimator in front of it, and a dependence on β.

What this repairs

Treating airlight as "white", or as a constant that has nothing to do with β, the sky, or where the camera happens to be pointing.

Assumes

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 1t1 - t 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 LsL_s . 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

  1. LA(d)=Ls(1eβd)L_A(d) = L_s\big(1 - e^{-\beta d}\big)

    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.

  2. βd1    LA(d)Lsβd\beta d \ll 1 \;\Longrightarrow\; L_A(d) \approx L_s\,\beta d

    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.

  3. f(β)=fmin+fmaxfmin1+κβ/βreff(\beta) = f_{\min} + \frac{f_{\max} - f_{\min}}{1 + \kappa\,\beta/\beta_{\text{ref}}}

    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 β.

  4. f(0)=1,f(βref)=0.45+0.552=0.725,f()=0.45f(0) = 1, \qquad f(\beta_{\text{ref}}) = 0.45 + \tfrac{0.55}{2} = 0.725, \qquad f(\infty) = 0.45

    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 t=eβdt = e^{-\beta d} 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 K1K^{-1} , take the camera's up-vector from its pitch and roll, and use the length of that ray's segment inside the layer as dd . 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.

Check yourself

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.

Euler View - ML Experiment Monitor