Jump to content
Aaron_

Z-depth pass

Recommended Posts

Hi folks,

I'm rendering depth pass and was wondering how can i control near and far on depth pass? black and white color

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks for the reply.

I'm using default, real values but when doing depth in comp, something is wrong, it blurs everything incorrect and also depth pass is too dark.

Any advice?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Thanks for the reply!

 

yes, alpha in that area is zero. If I put the un-preumult before the defoucus and premult after,

the background becomes (black color) like an alpha channel where the effect is not applied.

Share this post


Link to post
Share on other sites

my dirty solution is to create a black box as a background, but is so strange it does not work automatically.

 

Pz in Houdini:

 

03.jpg

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×