Analytic Fog Rendering with Volumetric Primitives

Fog that finally looks real? Gamers swoon, math nerds nod

TLDR: A developer shared a clear, math-light trick to place realistic fog using simple shapes. Fans got nostalgic about Morrowind’s mist while others debated if multiple fog sources simply add up, praising the approach as accessible and arguing it finally brings film-like atmosphere to games.

The internet just drifted into a fog frenzy after Matej Lou dropped a blog post on making mist look actually real using simple shapes (think spheres and boxes) and a bit of math. In normal-people speak: it’s a trick to put believable patches of fog exactly where you want them, instead of that flat gray soup you’ve seen a million times. The community vibe? Part cozy nostalgia, part “wait, I can do this?” curiosity.

One commenter, kqr, smashed the nostalgia button, pointing to classic Morrowind mods on the OpenMW engine and declaring the game “absolutely stunning” with volumetric fog—basically fog that lives in 3D space. The mood among old-school fans: developers always wanted this, but the computers back then couldn’t cope. On the other side, bee_rider rolled in like the cool TA, praising that it’s “just a little calculus,” and then stirred debate by asking if multiple fog machines in a scene simply add up or if high-density areas break the rules.

Cue the memes: folks joked about prom-night fog machines, GPUs “getting asthma,” and whether the Beer–Lambert law is more “bar law” than physics. The tiny drama? Nostalgia stans versus practical tinkerers—one chasing cinematic vibes, the other poking the math. Either way, the post keeps it accessible, avoids gnarly ray math, and gives creators a clear path to mood-rich scenes. Read the original on matejlou.blog.

Key Points

  • Fog rendering is framed as modeling absorption, with transmittance defined as outgoing-to-incoming light along a ray.
  • The Beer–Lambert law links medium density to transmittance; for constant density, total density equals density times ray segment length.
  • Basic distance fog in games often assumes a uniform medium across the view, sometimes simplifying the physics.
  • Fog can be localized by bounding it within primitives (planes, spheres, boxes) and computing the ray length inside these volumes.
  • Ray–primitive intersection is needed to determine in-volume ray segments; details are out of scope, setting up a technique for varying-density fog.

Hottest takes

"there are shaders for the OpenMW source port that add volumetric fog and the game becomes absolutely stunning with them" — kqr
"Just a little calculus" — bee_rider
"Can the effect of multiple fog emitters reasonably be modeled as the sum of their outputs?" — bee_rider
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.