render out a z depth map

I know in 3ds max you can render out z depth information, unfortuanately i dont have it and have to make do with blender (which rules btw :wink: )

how can i render out z depth, either as a seperate channel or as an image, wher ethe luminance values represent distance, would be very much appreciated as i do all my compositing in after effects, thanks

Don’t want to sound harsh, but I think this has already been answered here: http://blenderartists.org/forum/showthread.php?t=128380