Export Z-Depth to separate file, does not work properly ...!

   3228   3   0
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Hello

I would like to export Z-Depth of my scene using “Extra Image Planes”.
So in Mantra :
1) I add an “Extra Image Planes”
2) I select the "Pz“ vex variable, from the list…
3) In ”Different File" field, I add a jpg file-path.

The problem is :
When I hit Render to MPlay, the “Pz” renderd seems OK, but when I hit “Render to Disk” , the output of saved “Extra Image Planes” file is a flat image…!

Thanks for helping.

Here is my scene and render output:
Edited by Masoud - April 25, 2017 08:15:23

Attachments:
Export_Pz__01.hip (413.4 KB)
Pz channel.jpg (248.5 KB)

Masoud Saadatmand (MSDVFX)
User Avatar
Member
7835 posts
Joined: Sept. 2011
Offline
You can't save a channel like Pz to a jpg, because the values are almost all going to be greater than one. Mplay will automatically refit the values for display. This is to make viewing the information easier. It is not useful to remap depth values on output, as then the values would not be representative of depth. You need to use a high dynamic range format to output an imageplane with values outside the range of 0-1. Generally, when rendering, all image planes should be to exr/pic. If you need the files converted to other formats, such as ldr formats like jpg, then you need to process the images using compositing software, or a COP network in houdini. You will almost always want to apply some sort of tone mapping to rendered images, unless they are being used directly as numerical values, such as albedo/mask textures. Depth planes are used as-is in compositing software for effects such as depth of field, which requires the full range. If you desire the depth plane in 0-1 for some reason, it should probably be log encoded. Try adding an exponential to your shader, and export a new image plane with the result of (1.0-exp(-Pz)) as depth instead.
User Avatar
Member
407 posts
Joined: Aug. 2015
Offline
Thanks you jsmack.
Masoud Saadatmand (MSDVFX)
User Avatar
Member
238 posts
Joined: March 2013
Offline
I wouldn't use an exponent and bake in the 0-1.
Better to use the black and white levels on the grade node in Nuke
to remap your Z depth values.
I'm not lying, I'm writing fiction with my mouth.
  • Quick Links