Render Layer Z in orthogonal and perspective projection In my current Project, I use a Render Layer node and it's z output to obtain a depth image of the scene. My question now is, the distance obtained from this output, does give me the distance from the nearest object point to the camera plane. This is quite clear when using orthogonal projections where all rays run in parallel but what is this z-value when using perspective projection like in real cameras? Does blender already calculate the distance to the camera plane like shown in this image?



Or is it the distance along the ray?

Another question concerning this topic: Does anybody know an alternative way to obtain depth data in blender, different than using the render layer? (Unfortunately, This method does not work in background mode)
Quote from blenderguru


  View Z Depth and View Distance are very similar and most of the time it doesn’t really matter which you use. But to be thorough: the Z Depth is essentially a plane in line with the camera, and the Distance is literally the distance from the center of the camera emanating radially outwards.




This is for input, not for output but I assume that since the terminology is the same it should do the same calculation.

This brings me to the second question. You could use the above mentioned input on a separate render layer with a material override,