No jobs
Core 10 min 1 of 5

The Koschmieder model, honestly

Four symbols, three of them physical: what β, d and the airlight are actually constrained to be.

What this repairs

Reading the fog equation as "a white overlay whose opacity grows with distance", so β, the airlight and which depth goes into the transmission are all treated as free style parameters.

Assumes

The fog render is one equation, applied per pixel and per channel:

I=Jt+Ls(1t),t=eβd.I = J\,t + L_s\,(1 - t), \qquad t = e^{-\beta d}.

II is what the camera would see, JJ is the scene radiance without fog, LsL_s is the airlight, tt is the transmission, β\beta is the extinction coefficient in m1\mathrm{m}^{-1} and dd is a distance in metres.

Read casually this is an alpha blend toward grey, with β\beta as an opacity knob. Read carefully and not one of those symbols is free to be picked for how it looks. tt is determined by β\beta and dd ; β\beta is pinned to visibility by a definition that the next section derives; dd is a path length and not the contents of your depth map; and LsL_s is an estimate whose brightness depends on β\beta . The equation is also a mixture of radiances, so it belongs in scene-linear space — compositing it on sRGB codes is the mistake the camera topic opens with.

That has a consequence for how the figure below is read, and it is worth knowing before rather than after. The three colours it paints as swatches are delivered code values, because that is the only form a colour can be shown in; the mixture itself happened in light, behind the encoding. So the result really does sit between the other two, and the fraction it sits at is tt — but only if you measure the position in radiance. Check the same identity on the hex values and it will not hold, by exactly the amount the previous topic spent a concept on.

Beer–Lambert to Koschmieder to visibility

  1. dLds=βL    L(d)=L(0)eβd\frac{dL}{ds} = -\beta L \;\Longrightarrow\; L(d) = L(0)\,e^{-\beta d}

    Extinction: each metre of path removes a fixed fraction — not a fixed amount — of whatever is still left. That is the only assumption in the whole model, and it is what makes the decay exponential rather than linear.

  2. dLds=βL+βLs    L(d)=Jeβd+Ls(1eβd)\frac{dL}{ds} = -\beta L + \beta L_s \;\Longrightarrow\; L(d) = J e^{-\beta d} + L_s\big(1 - e^{-\beta d}\big)

    The same coefficient that scatters light out of the ray scatters ambient light into it, so the source term carries the same β. That is why the two weights sum to exactly one — it is conservation, not a convenient normalisation.

  3. ΔI(d)=I1I2=(J1J2)eβd\Delta I(d) = I_1 - I_2 = (J_1 - J_2)\,e^{-\beta d}

    Two surfaces at the same distance: the airlight term is common to both and cancels. Contrast decays exponentially and the decay does not depend on the airlight at all — only on how the contrast is later normalised.

  4. eβV=ε=0.05    β=lnεV=2.996Ve^{-\beta V} = \varepsilon = 0.05 \;\Longrightarrow\; \beta = \frac{-\ln \varepsilon}{V} = \frac{2.996}{V}

    Meteorological optical range is defined as the distance at which contrast has fallen to 5 % of its close-range value. Solving that for β is the whole of visibility-to-β, and the numerator being almost exactly 3 is where the rule of thumb comes from.

Now the part that gets skipped. The exponential wants a path length — the distance the light actually travelled from the surface to the lens. A depth map stores ZZ , the coordinate along the optical axis. These differ everywhere except on the axis:

d=Z(ucxfx)2+(vcyfy)2+1.d = Z\sqrt{\left(\frac{u - c_x}{f_x}\right)^{2} + \left(\frac{v - c_y}{f_y}\right)^{2} + 1}.

That is the planar-to-radial conversion, and it is the same square root the pinhole concept introduced when it insisted that depth means ZZ and not distance. It costs one pass over the depth map, and the pipeline does it before the render for exactly this reason.

Check yourself

The meteorological visibility is 80 m. What is the transmission of a surface at 80 m, and of one at 160 m?

Show answer

0.050.05 and 0.00250.0025 . The first is the definition — that is what visibility means. The second follows because transmission is exponential in distance, so doubling the distance squares the transmission: e2βV=(eβV)2e^{-2\beta V} = (e^{-\beta V})^2 . Two visibilities out, a quarter of a percent of the object's light reaches the lens and the pixel is essentially pure airlight. Note also that the answer needs no β\beta : any statement of the form "transmission at nn visibilities" is 0.05n0.05^{\,n} , whatever the fog.

Euler View - ML Experiment Monitor