z-depth or alpha depth pass/mask

I’ve been watching quite a few making of videos specifically the compositing aspects of animation and I’ve been wondering how to render in Blender a few certain render passes, or masks… forgot what they’re called. The one that interests me is called either a z depth pass/mask or an alpha depth… basically it allows you to make say dust or haze effects only at a certain distance in the frame. The pass/mask essentially layers (I think) the scene’s objects based on their distance from the camera. Any idea what I’m talking about and how to render and use this technique in Blender 2.5?

I just checked, it’s called a z-depth render pass. Any idea how to make one in Blender?

This is for 2.4, but the theory is the same:-
http://wiki.blender.org/index.php/Doc:Manual/Render/Passes

Thanks man. Now I feel stupid. Heh. I saw that before but didn’t realize what it was for.

Here is a recent thread on the subject, with example files.
http://blenderartists.org/forum/showthread.php?t=207306