From BlenderWiki
Tutorial
We all know the mist effect, it worked even with the old multitexture mode in the Game Engine, but with GLSL, we can now use Shading Nodes! One of the shading nodes is the camera data node, which lets us play with values such as View Z Depth and View Distance. Interesting things can be made out of this.
See also
http://www.yofrankie.org/tutorial-multicolor-mist/