When I was testing my depth of field filter, I had problems, having more precision for objects near camera; I read then some articles about linear depth, so I wanted to have it in panda.
Main article, the depth calculation comes from here, there is more links inside :
http://www.geeks3d.com/20091216/geexlab-how-to-visualize-the-depth-buffer-in-glsl/
Main post edited.