25

I want to render a depth map of a scene in Blender (v2.65a, using the Cycles engine) that uses the distance to the image plane (or any plane parallel to it, e.g. yz-plane) as the depth value.

It is possible to use the composite nodes to render a simple depth map as described in the documentation. The problem here is, that the z-values used are based on the distance to the camera, not the image plane. This means that lines parallel to the image plane will have varying z-values depending on their location in the rendered image, as can be seen in this example (rendering depicts the front of a cube, values have been normalized):

Depth map using the camera distance

I want a depth map that holds the same depth for points on a plane parallel to the image plane (without changing the overall projection, since the depth map still has to coincide with the normal rendering).

This could be achieved by post-processing the current depth map using a script that corrects the values according to their angle from the view direction, but I was wondering whether there is a way to get the right information right out of the rendering process.

So is there a way to use composite nodes (or a similar Blender feature) to render a depth map based on the distance to the image plane?

Michael Mauderer
  • 3,777
  • 1
  • 22
  • 49
  • 1
    Since this is an old question, I am curious If you found your answer. It appears like "Blender render" does this desired behavior as cycles and blender render have slightly different outputs. – Justin Meiners May 23 '17 at 04:09
  • 2
    I ended up applying a manual correction based on the angle. The scene I had was fairly simple (consisting only of planes parallel top the image plane) so that was the easiest solution. – Michael Mauderer May 23 '17 at 08:27
  • 1
    For future questions, you could also ask in [Blender Stack Exchange](https://blender.stackexchange.com/) – DarkCygnus Jul 10 '17 at 17:31
  • 1
    Sure, happy to. But I think Blender Stack Exchange didn't exist when I wrote this question. Maybe it should be migrated, now that it does exist? – Michael Mauderer Jul 11 '17 at 10:17
  • 2
    I flagged the question for migration through a moderator. – Michael Mauderer Jul 11 '17 at 10:34
  • 1
    @MichaelMauderer I was unaware migration was possible! Thank you for this meta-informational-tidbit. – Max von Hippel Jul 12 '17 at 19:59

0 Answers0