Announcement

Collapse
No announcement yet.

Raytraced Z-depth

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

  • Raytraced Z-depth

    Is there any development or demand for a raytraced version of Z-depth that would take account of alpha? I've hacked around this in the past by comping it with a raw refraction filter, but it's a messy workflow. It would be very useful for post-production DoF effects where you're looking through glass.

  • #2
    "affect all channels" (in the shader) does just that.
    What sense one such Z depth will make in post, though, is an altogether different matter.
    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
      The use case would be using a 3rd party DoF plugin like Frischluft lenscare

      I don't know why I didn't think of checking the refraction channel affect before, but it seems to be doing odd things, the depth info down't seem to correlate with the RGB. the same thing happens when the glass refraction IoR=0 which, as I understand means light rays shouldn't diverge from their original course as they pass through...

      Click image for larger version

Name:	Zdepth.jpg
Views:	188
Size:	7.0 KB
ID:	1084080
      Attached Files

      Comment


      • #4
        I looks perfectly correlated to me, though.
        What are you referring to, specifically?
        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
          Originally posted by ^Lele^ View Post
          I looks perfectly correlated to me, though.
          What are you referring to, specifically?
          The portion refracted through the left of the rectangle. You can see it shows as fully 255 white along its length until it hits the edge of the base plane, where it respects the alpha of that plane. That refractive rectangle is parallel to the cube face, so it should have a falloff if it was in 'colour only' or (my aim) show the depth of the plane/cube as they appear above and below.

          Comment


          • #6
            Does the above make sense? my logic is that the zdepth should obey the alpha, so you should see the cube through the glass in the z-depth pass.

            Granted this wouldn't be of any use if you applied Frischluft to the RGB in post, but you could probably get the desired effect by adding the reflection over the top of the effect layer.

            Comment


            • #7
              I think it's what happens when trying to trace the Z through refractions, though.
              If you had to focus in the glass contents (which is around about why we did this, if i get it right), you'd have to see the refraction depth, not the glass' one.
              Much like focusing an image in a mirror, no?
              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


              • #8
                In the case of a mirror, or reflective surface, could you not set the material's reflection to 'all channels' and refraction to 'color only', and vice versa if you wanted to get the refraction element represented in the z-depth? It seems like an odd mix of the two at the moment. I'll have a further test.

                Comment

                Working...
                X