Announcement

Collapse
No announcement yet.

Unreal-like depth fade parameter for opacity (v-ray gpu)

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

  • Unreal-like depth fade parameter for opacity (v-ray gpu)

    Hi, how we can recreate this effect (fake depth on a flat surface) with v-ray? It is an easy and fast way to create an atmosphere. You can watch it in the rebirth video by quixel here https://youtu.be/0iQJkSpOoOQ?t=1294
    I played with fog parameter, but cant achieve such effect with a smooth transition on the plane with cloud texture. https://www.screencast.com/t/21dHrc3ZEI
    any suggestions?

  • #2
    I guess you can use the vraydistancetex as a mask and the ground plane as the object for the distance.
    A.

    ---------------------
    www.digitaltwins.be

    Comment


    • #3
      Originally posted by Vizioen View Post
      I guess you can use the vraydistancetex as a mask and the ground plane as the object for the distance.
      Yep, but it is not the same. With distance texture i get fading from bottom to top. But if you take a look on video, the effect i want to create is the fade “inside” the plane. If we take z-depth channel from render and input it with proper mapping on opacity slot, i think that we achieve something similar to depth fade. Fog parameter is working close to it, but i don’t know how to combine it with 2d texture in opacity
      .

      Comment


      • #4
        EDIT #2: I'm not sure i get what you mean: the video *is* fading the texture from the bottom of the sprite, as a distance from the terrain.
        There is however a circular gradient mapped on Opacity, which likely multiplies the effect of the distance fade.
        Click image for larger version  Name:	gradient.jpg Views:	1 Size:	491.0 KB ID:	1057219
        Last edited by ^Lele^; 02-01-2020, 11:48 AM.
        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
          Not sure the Z depth channel info would be the way to go here actually. I'm not the tech savvy person Lele is for instance but the zdepth is calculated from the camera distance so if the camera changes, the effect changes as well. If you want to blend with the "inside" of the plane then you can use a softbox map blended with a distance tex map in a comptex map to achieve the effect I think, unless I really didn't understand the video or what it is trying to achieve.
          A.

          ---------------------
          www.digitaltwins.be

          Comment


          • #6
            Indeed, Ashley's approach would work too, i think.
            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
              Originally posted by Vizioen View Post
              Not sure the Z depth channel info would be the way to go here actually. I'm not the tech savvy person Lele is for instance but the zdepth is calculated from the camera distance so if the camera changes, the effect changes as well. If you want to blend with the "inside" of the plane then you can use a softbox map blended with a distance tex map in a comptex map to achieve the effect I think, unless I really didn't understand the video or what it is trying to achieve.
              yes, z-depth changes. But maybe there is some tip to use calculated depth from the camera on opacity? About distance texture, softboxes and so on: just take a look at the video I provided in the first post, here is not a simple gradient transition, but the transition in depth. I make a simple scene in unreal to demonstrate it and several screenshots with plane and depth fade parameter. Also, I take a screenshot from the alpha channel just take a look on gif-animation where I moving the plane back and forth. Similar effect demonstrated on video here https://youtu.be/0iQJkSpOoOQ?t=1384
              And this achieved by using only a flat plane without any volume. I think now it is more clearly
              Click image for larger version

Name:	image_54526.png
Views:	802
Size:	40.4 KB
ID:	1057251Click image for larger version

Name:	image_54525.png
Views:	809
Size:	475.5 KB
ID:	1057252Click image for larger version  Name:	image_54527.gif Views:	1 Size:	674.9 KB ID:	1057250




              Attached Files
              Last edited by andrei_petrukovich; 03-01-2020, 02:35 AM.

              Comment


              • #8
                Eh well, then perhaps my setup was not so OT.
                Check this out, and feel free to let me know where it doesn't work.
                The max file is for 2020, the attached image is the alpha of distant planes (the further they are, the more transparent they are.).
                If you unlink the distance object from the camera, you can then drive the distance separately from the view.
                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


                • #9
                  Originally posted by ^Lele^ View Post
                  Eh well, then perhaps my setup was not so OT.
                  Check this out, and feel free to let me know where it doesn't work.
                  The max file is for 2020, the attached image is the alpha of distant planes (the further they are, the more transparent they are.).
                  If you unlink the distance object from the camera, you can then drive the distance separately from the view.
                  hi, thanks but it is not the same ^) By this setup you change the opacity on the whole object. The rasterization of gif animation clearly shows how the plane is fading in depth (from the camera, not from bottom to top).
                  Ok, let talk with another example, the effect I searching it is similar if we rendered the image, take it in photoshop and place some cloud image with alpha by the depth channel of that render. So we achieve a fake volume cloud. I take some renderers with your setup and illustrate it in photoshop. By default, you have a transparent object in case of distance, but the whole object, if we can somehow multiply that transparency on the depth we got that effect like in unreal engine.
                  Attached Files

                  Comment


                  • #10
                    So, i re-watched the video, and listened very closely to the author.
                    A) He adds something *identical* to the distance texture, but uses it with respect to the terrain, not the camera. (to quote the speaker "It allows the fading of the card from the intersection (with the ground, n.d.r.)").
                    The modified setup using the ground as distance object is attached. For your convenience, i put the distance texture inside of an output node, with which i drive the distance gradient more precisely.
                    For easier viewing, i assigned the texture to the color of a self-illuminated material, so just starting IPR would show you the behaviour.

                    B) I'm not quite sure of what i am looking at in the GIF animation you last posted. That is what the first setup i sent you did, just as Vizioen suggested.
                    If you wanted both behaviours combined, all you'd need would be to multiply the two distance textures (the one providing Z-Depth, and the one providing intersection distance from the ground).

                    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


                    • #11
                      Originally posted by ^Lele^ View Post
                      So, i re-watched the video, and listened very closely to the author.
                      A) He adds something *identical* to the distance texture, but uses it with respect to the terrain, not the camera. (to quote the speaker "It allows the fading of the card from the intersection (with the ground, n.d.r.)").
                      The modified setup using the ground as distance object is attached. For your convenience, i put the distance texture inside of an output node, with which i drive the distance gradient more precisely.
                      For easier viewing, i assigned the texture to the color of a self-illuminated material, so just starting IPR would show you the behaviour.

                      B) I'm not quite sure of what i am looking at in the GIF animation you last posted. That is what the first setup i sent you did, just as Vizioen suggested.
                      If you wanted both behaviours combined, all you'd need would be to multiply the two distance textures (the one providing Z-Depth, and the one providing intersection distance from the ground).
                      yep, actually that parameter in UE expression is used to hide unsightly seams that take place when translucent objects intersect with opaque ones. But working it in world space and results have a volume look like. I combined Lit and alpha channel in 1 screenshot and draw green arrow by the way fade is applied.In distance texture, we got a transition on red and blue arrows in that example (in local space). So we got something like a portal, with depth inside the plane. Bad to me that I can't describe it more clearly, so we can close that thread.
                      Attached Files

                      Comment


                      • #12
                        Nono, it's me not getting it, not to worry.
                        I don't think it's doable right now, there is no way that i can think of to reproject the stuff behind the plane unto the plane itself, so any attempt of using, f.e., the vraysamplerinfotex with pPos would fail, as the plane covers the stuff behind it.
                        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


                        • #13
                          Originally posted by andrei_petrukovich View Post

                          yep, actually that parameter in UE expression is used to hide unsightly seams that take place when translucent objects intersect with opaque ones. But working it in world space and results have a volume look like. I combined Lit and alpha channel in 1 screenshot and draw green arrow by the way fade is applied.In distance texture, we got a transition on red and blue arrows in that example (in local space). So we got something like a portal, with depth inside the plane. Bad to me that I can't describe it more clearly, so we can close that thread.
                          this is really interesting to have directly in 3d !
                          I use similar approach but in post ..if Vray allow as to use the zdpth pass inside the material tree that effect would be possible
                          it is like taking the z depth of the scene behind the plane and use it as mask on the plane itself .
                          Andrew used -kinda- similar approach here
                          https://www.youtube.com/watch?v=FivFZhcQFi4
                          https://www.youtube.com/watch?v=FivFZhcQFi4">https://www.youtube.com/watch?v=FivFZhcQFi4" type="application/x-shockwave-flash" width="540" height="380">

                          -------------------------------------------------------------
                          Simply, I love to put pixels together! Sounds easy right : ))
                          Sketchbook-1 /Sketchbook-2 / Behance / Facebook

                          Comment


                          • #14
                            Originally posted by ^Lele^ View Post
                            Nono, it's me not getting it, not to worry.
                            I don't think it's doable right now, there is no way that i can think of to reproject the stuff behind the plane unto the plane itself, so any attempt of using, f.e., the vraysamplerinfotex with pPos would fail, as the plane covers the stuff behind it.
                            Could be way of track here but what about using a camera map per pixel map? (never used it so can't get it to work without some R&D).
                            A.

                            ---------------------
                            www.digitaltwins.be

                            Comment


                            • #15
                              Originally posted by Vizioen View Post

                              Could be way of track here but what about using a camera map per pixel map? (never used it so can't get it to work without some R&D).
                              Tried, with samplerinfotex in Point mode, didn't work. ^^
                              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