Announcement

Collapse
No announcement yet.

Alpha (and Zdepth) of objects in Refraction/Reflection

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

  • Alpha (and Zdepth) of objects in Refraction/Reflection

    Two questions:
    1) How do I render the rgb and alpha of an object that is reflected or refracted (with its alpha intact in the render) in one pass?
    2) How do I compute the reflected distance of an object? (eg. If an object is in front of camera, but reflected in the glass wall 20 feet behind it, the focal distance to the reflection is essentially 40 feet behind the object).

    I have a feeling that if there is any answer to #1, there will be an answer to #2.

    Thanks, in advance.

    - Jim

  • #2
    From my understanding, I fear you are on a looser there, Alpha gives transparency with no regard to refraction or reflection, Zdepth seems to return distance to first surface encountered. Depth of field can work - depends on renderer, if it is calculated in a manner similar to motion blur (precessing camera around camera target I think) then it can work - seems to with V-ray.

    Comment


    • #3
      I know how it works, but given that V-Ray would like to be a "physcially accurate" renderer, we, as users, need to point out rendering situations where this ideas still falls flat. So, it may be that V-Ray is incapable of calculating distance over and reflection, but if don't ask, it will never happen (unless it is possible, and I have yet to find the person who knows a manner in which to make it work).

      - Jim

      Comment


      • #4
        I'm not even sure I uderstand a scenario where such render information is needed.
        Last edited by Braiz; 05-05-2021, 04:58 AM.

        Comment


        • #5
          Braiz It makes sense to have reflections like in real work sharp where objects are in focus and blurred where it is out of focus.
          So it's of course great, when a renderpass can reproduce that, if if it's not easy in such "layered" situations.

          Comment


          • #6
            How about a VRay distance Tex in your self illumination channel(black everywhere else) for all objects but the glass and render it as an rgb pass?

            Note though that post dof may not work correctly. Usually you have to do it in layers/passes. Or render it in.

            Comment


            • #7
              1) How do I render the rgb and alpha of an object that is reflected or refracted (with its alpha intact in the render) in one pass?
              You need to turn on "color + alpha" for the node, and the ones it reflects/refracts into.
              This will get very messy, very quickly.
              Alas, it works as per your request, i think.

              Click image for larger version  Name:	beauty.png Views:	0 Size:	135.1 KB ID:	1118926Click image for larger version  Name:	alpha.png Views:	0 Size:	57.8 KB ID:	1118927

              2) How do I compute the reflected distance of an object? (eg. If an object is in front of camera, but reflected in the glass wall 20 feet behind it, the focal distance to the reflection is essentially 40 feet behind the object).
              You can do this with helper nodes in the 3d scene (Tapes, camera ranges, etc.), and even then, you can only approximate this for exceptionally simple cases (i.e. a flat plane reflector, a first reflection bounce).
              While you could use samplerInfoTex and/or various tricks rendering with passes or LPEs, i fear trying to do this in camera with the beauty is bound to fail (negative values will need clamping, and so on.).
              Expecting the engine to track the (recursive) shader on focus picking seems to me a bit too optimistic, and i have personally never seen it done by anyone (which however doesn't mean it cannot be achieved.).

              I'd be curious to see a sample from some other (raytracing) engine which can do what you ask, so to see how it's done (on both requests, should your first one not be satisfied with the approach above.).
              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

              Working...
              X