Jump to content

Z-depth pass


Recommended Posts

it's much better to leave Z as raw floating point distance from the camera than remap to some arbitrary range 0-1 which doesn't tell you anything

to do proper DOF in comp you need real values otherwise you'll be just guessing

but if for any reason you need custom range just remap it in comp, much more flexibility

  • Like 1
Link to comment
Share on other sites

if you're using Nuke then in ZDefocus you need to set Math parameter to depth instead of default far=0

or if you really want to remap depth in nuke to normalize certain range to 0-1 then append Grade node acting on your zdepth channel and adjust blackpoint and whitepoint

in other words if you want to depth range of 10-80 to become 0-1 then set blackpoint to 10 and whitepoint to 80

  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...
Hi folks, 

 

I'm rendering depth pass (Open EXR) from Houdini 13 to Nuke 8 the extra image planes Pz.

 

My problem is that Nuke interprets the depth of field incorrectly:

gives the red color to the background, while it should be blue.

 

 

Do you have the same problem ?

(in ZDefocus, I set Math parameter to depth)

 

01.jpg

 

02.jpg

Link to comment
Share on other sites

It's probably because the background is giving you a depth of zero. I'm assuming the alpha in that area is also zero? You can try overing the zdepth on a really high number constant in Nuke, or maybe just un-preumult before the defoucus and premult after.

Link to comment
Share on other sites

it works automatically perfectly, but maybe you expect something else

 

so if you render your scene and apply ZDefocus based on depth channel it will blur it nicely and since there is nothing outside of alpha region of the beauty pass as well as nothing out of the alpha region of the depth pass it will work together and it will even nicely blur the alpha edge if out of focus

 

if you are however trying to apply rendered depth channel to already composited image (so your render over some background) it will not do it correctly as there is no depth information on the background pixels

and you can't expect houdini to fill the empty portions of the image with infinite depth since there is not always the case

 

it's very easy to composite the depth channel over plane of certain depth to get exact background depth as you want (if there is no bg depth information in the first place) so no need to render it like that from H

 

however the most common is to composite the depth channels from all elements together so you can get combined depth channel that you can use to apply z-depth to the final composited image at the end

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...