Announcement

Collapse
No announcement yet.

Zdepth in Nuke

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Zdepth in Nuke

    I'm wondering which of the "math" settings for the Zdefocus node in Nuke would be appropriate for the output of Vray's Zdepth RE? Here are the choices:


    direct : The Z value in the depth channel directly controls blur. For example, if Z is 0.5, then the blur size will be 0.5 times the value of the size control (unless this is bigger than maximum , in which case it will be clamped to maximum ).

    depth : The Z value in the depth channel is the distance between the camera and whatever is in the image at that pixel.

    far = 0 : The Z value in the depth channel is equal to 1/distance. The values are expected to decrease from large positive values close to the camera to zero at infinity. This is compatible with depth maps generated by Nuke and RenderMan.



    far = 1 : Near plane = 0, far plane = 1. This is compatible with depth maps generated by OpenGL.



    -direct : As with the direct mode, the Z value in the depth channel directly controls blur. In other words, each layer is blurred by the same amount as in the direct mode. However, in this mode, the layers are interpreted as being in the opposite order, so a higher depth value places a layer in front of another rather than behind it.



    -depth : The Z value in the depth channel is - distance in front of the camera. This is the same as depth , but the distances are negative to start with.



    far = -0 : The Z value in the depth channel is equal to - 1/distance. The values are expected to increase from large negative values close to the camera to zero at infinity. This is compatible with depth maps generated by Maya.



    far = -1 : Near plane = 0, far plane = - 1
    Since in Vray white is far, I'm thinking it would be "far=1" however I seem to be getting better results with "depth" on the tests I've run. So I'm hoping someone can clear up what the correct math would be. Thanks!

  • #2
    I always swap the depth black and white.
    So white is close and black is far.
    Then it work straight away in Nuke.
    Something to be aware is the range from W to B as sometime if the range is small the depth blur wont be visible.
    Otherwise it works fine.
    Portfolio: http://www.cgifocus.co.uk

    Comment


    • #3
      Here's what I've been able to conclude so far:
      I'm rendering out EXR (linear workflow) and have the zdepth with filter and clamp off. The far value is set to white (the default).

      In Nuke far=1 works when the depth channel is fed into the zdefocus node. However I have observed that setting it to "depth" looks even better (it has less halo effects). For this to work I need to merge a white constant under the depth so it has a white background (Vray renders this black even though the far value is set to white).

      Comment


      • #4
        Thought I'd update this for others who may be having the same issue:
        1) Zdepth works best in Nuke with the "depth" option, not the "far=1" option. This assumes clamping is off on the zdepth RE.
        2) There is currently a bug in V-Ray that causes the background to render in the wrong color for zdepth. That's why I was getting the halo effect. The workaround is to create a really big sphere (cast shadows off).

        Comment


        • #5
          Thanks for the tip and the update.

          Comment

          Working...
          X