#z-buffer info
There's no direct way to do that, but there's a workaround.
Make a version of your scene in which all the objects have white matte material
applied to them. Then, set depth cue shading on, and set your camera outer
atmosphere range to the extent of the scene (just outside your farthest
object). Now, when you render the scene, you'll get the equivalent of a
depth-map.
– G