XNA: Adding fog to a LPP (or deferred) pipeline  Hi folks,
After a long delay, here is one more gift for you: how to add
fog to your scene. I will talk about global fog, although it can
be easily extended to local fog volumes like spheres, cubes,
etc.  Fog is a great visual feature in any rendering. It helps
not only creating atmosphere and environment cues, but also
improves the depth perception of your scene. As a bonus, you can
use it to camouflage the unpleasant pop in/out side effect of
distant object culling.  Here we have same view with and without
fog:  The effect is basically a color interpolation based on the
depth of the current pixel. You can have a look here and here
for some good tutorials, as I won’t enter the gritty details of
the physics behind it (it’s not that hard, though: don’t be
scared to learn the real deal).  In the fixed pipeline era, it
was really simple to add fog to your scene: just enable a flag,
setup two or three parameters and voilà, it’s done. Now, in the
programmable age, y