Announcement

Collapse
No announcement yet.

Making sense of the VRayZDepth

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

  • Making sense of the VRayZDepth

    Hi, I am writing an exporter that combines 3ds Max scene data and information from VRayZDepth to an image processing software. It needs accurate Z-depth values in order to do this correctly. To my surprise, the values rendered by VRayZDepth are inconsistent compared to both the 3ds Max scene and other renderers. An object with a distance of 100 renders with a depth value of 100 in both Corona and Redshift, but in V-Ray this value is instead 0.5. Does anyone know the reason for this, and what unit system V-Ray use when rendering VRayZDepth? Is there a way to change this? I hope someone here can help me out.
    Rune Spaans
    www.superrune.com

  • #2
    You have two ways to get the exact distance in units.
    The Z-Depth set up as shown, or the pPos in camera space, for which you'd only use the Z (inverted.)

    Attached Files
    Lele
    Trouble Stirrer in RnD @ Chaos
    ----------------------
    emanuele.lecchi@chaos.com

    Disclaimer:
    The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

    Comment


    • #3
      Thanks! I will try pPos instead, that sounds like the exact thing that I need.
      Rune Spaans
      www.superrune.com

      Comment


      • #4
        A bit more wasteful at 32bpc times three channels, but if you keep the transform matrix of the camera, you can turn the element into world coordinates data, so perhaps it becomes quite useful elsewhere.
        Lele
        Trouble Stirrer in RnD @ Chaos
        ----------------------
        emanuele.lecchi@chaos.com

        Disclaimer:
        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

        Comment


        • #5
          The VRaySamplerInfo had exactly the kind of scale that was needed for the image processing software, apart from the fact that I need the Z depth to be positive values. The VRaySamplerInfo outputs Z as negative values. There is a multiplier in the Render Element, if I could set that to -1.0 the problem with be solved. Unfortunately, the spinner does not go below 0.0, so I've hit the wall on this solution as well. So close!
          Rune Spaans
          www.superrune.com

          Comment


          • #6
            Indeed, I had assumed you could do the -1 multiplication in post.
            Doesn't Z setup as i have shown work for you? It was giving me the same values as pPos, but positive.
            Lele
            Trouble Stirrer in RnD @ Chaos
            ----------------------
            emanuele.lecchi@chaos.com

            Disclaimer:
            The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

            Comment


            • #7
              You are absolutely right! Z setup is working as it should. I simply forgot to set the min max values as you had done, can't believe I missed that! Thanks again!
              Rune Spaans
              www.superrune.com

              Comment

              Working...
              X