
http://aescripts.com/efx-render-elements-z-depth-tools/
These plugins will let you make the most use of a ZDepth pass that you often render out from a 3d application. It's a pass that stores the information about the distance from camera for each pixel - there is really a lot you can do with this data.