Set and display correct Z depth values Blender render I have an object in my scene and I wonder how I can render it so that each pixel will have the distance from the camera in metrics unit? where the the nearer to the camera it will have whiter colour and the further from the camera will have blacker colour and greyish in between. I don't want to use normalization as this will ulter the correct Z depth values so I'm trying to use the Map Value node but I'm not sure how to set the correct values where logically the pixels nearer to the camera will have smaller z values than pixels far from the camera.

This is my current status:



As seen in the below image, the z values of the closer parts is bigger than the values of further parts, I don't know how to fix this:



My .blend file can be found here:
This is the default formatting of Blender's z-buffer, so I'm not sure where you're stuck? Are you trying to get these values into the RGB channels? If so, you can simply copy them like this:



Remember to save this in a linear floating point format (such as OpenEXR). Formats such as PNG will mangle this data, as they are not meant to store depth.

I should probably add, using the Combine RGBA node here isn't strictly necessary, it still works if you connect Z directly the Image output. Using the Combine RGBA just lets you specify each channel explicitly to be on the safe side.