Announcement

Collapse
No announcement yet.

Z-Depth with Alpha information?

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

  • Z-Depth with Alpha information?

    Just wondering if there's a way in VRay of creating a Z-Depth map which accurately recognises the alpha of clipmapped textures? At the moment I workaround by rendering the whole scene once and saving as RGB and Alpha channels, then I render a second time (extremely low quality), minus clipmapped trees and save the Z-Depth channel to get a depth map for the whole scene. Then I render a third time (again, at low quality) only the clipmapped trees (no ground) and save just the Alpha channel as png. Finally I composite the Z-Depth and 3rd Alpha renders in Photoshop so it becomes a useable Z-Depth map for fog, DoF, etc (see attached). The trouble is that the saved Z-Depth channel doesn't produce accurate results where clipmapped materials overlap- the geometry produces rectangular boundaries which affect the tone of the depth map in front and behind it.



    I've tried a few things, but other than exporting the alpha channel of the trees separately from the Z-Depth channel of the whole model and editing them together in PS I can't find a way to make the VRay default Z-Depth channel take clipmapped materials into account. Anyone got any ideas? Really seems like the Z-Depth channel ought to be able to read alpha material information rather than just geometry. One for the Wishlist?

    Thanks in advance,
    Jackson
    SU 2018 + VfSU 4.0

  • #2
    Re: Z-Depth with Alpha information?

    The reason why clipmapped trees show up in the Zdepth channel is because they are truly there. V-Ray sees that surface and intersects rays with it, however, its set to be completely transparent, so it doesn't show up in the rendering, but its not like that part of the surface disappears from the rays being traced.

    Your workflow for getting a clip mapped zdepth seams fine, but I think you're issue is in how you get the extra passes. Presumably you've got all the information, in terms of the visual result of the final rendering, from the first pass. The second and third passes are just to set up the zDepth as you need it, so I would turn off GI, turn off Lights, and turn off reflections/refractions (in Global Switches for the last too). The resulting render will be black, but the alpha information and zDepth will be calculated exactly the same. One thing that you don't want to do is skimp on the AntiAliasing. In fact you want to make sure that the "bottom end" of your AA setting aren't set so low that the other channels that you need look like crap.
    Damien Alomar<br />Generally Cool Dude

    Comment


    • #3
      Re: Z-Depth with Alpha information?

      Originally posted by dalomar
      The reason why clipmapped trees show up in the Zdepth channel is because they are truly there. V-Ray sees that surface and intersects rays with it, however, its set to be completely transparent, so it doesn't show up in the rendering, but its not like that part of the surface disappears from the rays being traced.
      This one of the explainations that makes the programmer happy and let the artist cry. For me it sounds like the description of a bug. It's a wonder, that the alpha channel show the transparency and not the truly geometry. Maybe once a day I start to think like a raytracer and I happy about something like this.
      If a transparency mapped surface is raytraced and the surface is transparent, than the surface behind are show at the rendering. I see no reason why it shouldn't be done for the z-depth calculation too. Shouldn't the artists need be the first goal? If render an architecture scene than I need a z-depth that match the rendering and not the internal calculation. :'(
      www.simulacrum.de - visualization for designer and architects

      Comment


      • #4
        Re: Z-Depth with Alpha information?

        For you its a description of a bug. For me its the description of how the program works. This may not be desirable behavior for you guys, but there is a reason why the behavior is happening, and currently V-Ray is acting as it was designed to act. If that's the case, then I do not qualify this as a bug because everything is acting as it is supposed. Of course, we can change how this is designed to act, but that's a feature change not a bug.

        The reason why the alpha channel is transparent is because it is looking at material definitions to determine a give surface's visibility to what's behind it. The zDepth channel works much differently and is concerned about the distance between the camera rays and the first intersection that it encounters. After that intersection, the ray is fundamentally changed. Technically, you're not actually seeing through what's behind the surface, but the material's contribution at that point is set to be 100% of what is visible behind the surface and 0% of the material definition itself.

        I know you don't like any of the explanations, Micha, but the reality is that the rendered result is a by product of many many technical processes coming together. Its not a question of making the choice not to do what "you" think should be done (it makes no sense for us to make the conscious decision to do something that you guys won't like), its a matter of working within the technical limitations of how the software functions. I don't believe that this is something that we can't change, but to completely disregard the reason why it works how it works is frustrating for me and the development team here.
        Damien Alomar<br />Generally Cool Dude

        Comment


        • #5
          Re: Z-Depth with Alpha information?

          I guess what Micha's getting at is that when you know that VRay can extract Z-Depth information accurately and Alpha information accurately it is a little frustrating that it doesn't combine the two in some way (LOL, now that a non-progammer's way of putting it! ;D). Although it displays in the Frame Buffer like an ordinary Z-Depth map (i.e. all clipmapped trees are displayed as grey tone rectangles) when saved as png, it combines the alpha channel and creates an almost useable Z-Depth map with clipmapped tree outlines. The catch is that where these clipmapped planes overlap you get the vertical boundaries between one depth tone and another, see below. It would be great if, in a future version the Z-Depth calcs could read alpha info rather than just geometry.

          SU 2018 + VfSU 4.0

          Comment


          • #6
            Re: Z-Depth with Alpha information?

            Any info from the development team? If it is a Vray core issue, Vlado could solve it. I'm working on an arch viz and found no way to get a light fog effect with transparency mapped trees. Without a light fog effect the scene looks unreal and it would be good to know, that this problem will be solved per next release. Also I can't avoid the trees, because I'm happy that I have this good looking low poly trees.
            Sounds like a simple feature and I miss it often.
            www.simulacrum.de - visualization for designer and architects

            Comment


            • #7
              Re: Z-Depth with Alpha information?

              Jackson, I found the perfect workaround - set a plane in front of the camera, so that the camera view goes through. Than use for the plane a material with a refraction layer only - set IOR 1 and fog color a light grey. Than I apply a white emitter material to all surfaces. Now render the scene (GI disabled) - if the fog multplier is right adjusted, than it should look like this.



              PS: I hope a workaround dosn't cause that a regular solution get not neough energy anymore.
              www.simulacrum.de - visualization for designer and architects

              Comment


              • #8
                Re: Z-Depth with Alpha information?

                Wow, what a workaround Micha! How the heck did you come up with that? Great work!
                SU 2018 + VfSU 4.0

                Comment


                • #9
                  Re: Z-Depth with Alpha information?

                  Originally posted by Jackson
                  How the heck did you come up with that?
                  I knew you will like it. ;D
                  www.simulacrum.de - visualization for designer and architects

                  Comment


                  • #10
                    Re: Z-Depth with Alpha information?

                    Very useful, thanks alot!

                    Comment


                    • #11
                      Re: Z-Depth with Alpha information?

                      Today I found that this trick can be used to fade out a model (jewellery, watches) in a black background like at this image. Only a plane behinde the watch body is needed and the wristband fae out.

                      http://www.mirage-cg.fr/watches/slides/watch06.jpg
                      www.simulacrum.de - visualization for designer and architects

                      Comment


                      • #12
                        Re: Z-Depth with Alpha information?

                        Hi Micha

                        I just discovered your post here...
                        again very creative and intelligent

                        thanks!

                        Andy

                        Comment

                        Working...
                        X