Rendering a scene and writing the 'Z-buffer' into an EXR file using 'Blender Cycles', I get a depth map. That depth map differs from the depth map which is produced by 'Blender Render'. Given its shape, I was assuming that the depth map corresponds to the 'sight ray's length'. However, that did not work out.

I derived my formula as follows:

enter image description here

ys [px]: y-coordinate of the pixel
cy [px]: y-coordinate of the principal point.
d  [m/px]: density, i.e. length / pixel on the camera sensor 
           (y_size [m] / y_size [px])
f  [m]:  focal length
zs [m]:  length of the 'sight ray'
zc [m]:  orthogonal distance to lense's plane
         (z-coordinate in camera centered coordinates)









But, that does not seem to work out. What am I doing wrong? What would be the formula?


1 Answer 1


The aforementioned formula is the correct, only that Blender provides the depth at $(x+0.5, y+0.5)$ at pixel $(x, y)$. The general solution is


respectively with the offset:


if density in x and y differs:



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .