Announcement

Collapse
No announcement yet.

Is this possible

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

    #91
    You can selectively toggle whether a material should use separate translucency. (It's on by default)

    In this case you should be able to toggle it off for the water surface, as well as any other material that should be affected by the post process material, to get the result you want.

    Btw. you are right that this blend seems to have the same effect as using "before translucency". Using that is probably more efficient than doing the blending in the post process material. (Selectively toggling separate translucency on and off also has the same effect in both cases)

    Regarding god rays: these are indeed caused by the waves. I believe you already had caustic patterns in your lighting. Underwater god rays are basically the interaction between these caustic patterns and particles in the water. The absorption effect I posted assumes a uniform light distribution as it's is much cheaper. However, there are many ways to fake god rays in a cheap manner. The current build-in effect is a cheap and effective approximation as long as you are looking at the light source. More correct ones that are also visible when looking away from the light would be a little more complex.

    Looking at the kite demo you can actually see them in the final scene in the cave with all the kites, which seems to indicate that Epic may have implemented a system for those in 4.8. So you could wait for the 4.8 preview to be released to see how they pulled it off or implement your own system right now.

    Comment


      #92
      Thanks Arnage,

      I did not know about the separate translucency, my water plane now blends with the effect

      About the kite demo, interesting, you have a sharp sense of observation, the effect is quite subtle but it looks good, at first i thought it was the already implemented sun shafts from the directional light but remembered that those are dependent on the camera orientation? I wonder how performance heavy they are, some of the effects in UE4 are requiring that you have the scalability settings set to high or epic

      Comment


        #93
        Do you think it would be possible to mask the absorption effect, right now i rely on lerps to fade the effect when i get to the ship interior, the main issue is being able to see both the underwater and the ship's interior when inside the suit and standing half way underwater, the only thing i have been able to do was to lerp the turbidity distance depending on my height, and make the distance far enough so it wouldn't affect the ship's interior but still hide my underwater terrain

        I doubt this is possible but it doesn't hurt to ask

        Comment


          #94
          *EDIT*, doh, I accidentally replied when looking at page1 of this thread. Somehow I missed all the other posts talking about this problem. The below approach would be for a case where the water was a real plane being masked by a box mask in the world. It would build the lip into the water material rather than on another window mesh.

          It is possible but kinda tricky since you need to "project" your plane mask forward by solving the right triangle defined by your view vector and desired water lip height.

          To solve the triangle remember that a^2 + b^2 = c^2 where c is hypotenuse. Can get hypotenuse length for a unit vector side by doing dot(cameravector,PlaneNormal). Then you get the slope by doing a/b (aka rise/run).
          Then the forward extention amount is simply lipheight * (1/Slope).

          So you keep your current mask as the Lerp alpha between top and side water. Then you use the larger projected mask to cut out beyond the water lip.

          To define the normals of the lip you could Lerp between two vectors, an upvector and the normal of the inside of your glass pane, using the distance between the original mask and extended mask.
          This will only work for when the view is above the water looking down. Solving the other case is also possible but requires a bit more work that isn't coming off the top of my head.
          Last edited by RyanB; 05-15-2015, 07:45 PM.
          Ryan Brucks
          Principal Technical Artist, Epic Games

          Comment


            #95
            Originally posted by Arnage
            Actually the implementation I posted before already handles this. If you go back to the full post process shader in post number #71 you can see I added a part that limited the influence to only affect surfaces below the water level.

            Is that what you meant?
            Not exactly, the method in post #71 is similar to what i use right now, when in the suit with head above the water surface i can see the underwater part without the effect, when under i can see the ship's interior with the effect, this is happening because i can see both underwater and above water when floating at the surface

            I wanted to know if it would be possible to have the effect rendered at all time (or at least slightly above the surface to cover my helmet) but mask the effect from being rendered inside my ship, so that when floating at the surface i can see both the underwater part and the ship interior like they should be

            @RyanB, i'm going to have to re-read that a couple of times, i have used masks in the past to mask out materials from being rendered in specific shapes and locations and was wondering if a similar approach could work, i'm not very good with maths so it might take me a while to understand what you're trying to explain

            Thanks

            Comment


              #96
              Originally posted by KhenaB View Post
              Not exactly, the method in post #71 is similar to what i use right now, when in the suit with head above the water surface i can see the underwater part without the effect, when under i can see the ship's interior with the effect, this is happening because i can see both underwater and above water when floating at the surface

              I wanted to know if it would be possible to have the effect rendered at all time (or at least slightly above the surface to cover my helmet) but mask the effect from being rendered inside my ship, so that when floating at the surface i can see both the underwater part and the ship interior like they should be

              @RyanB, i'm going to have to re-read that a couple of times, i have used masks in the past to mask out materials from being rendered in specific shapes and locations and was wondering if a similar approach could work, i'm not very good with maths so it might take me a while to understand what you're trying to explain

              Thanks
              You're right, that's why I deleted the post when I saw Ryan's and noticed that I was wrong, but I guess you had read it already

              Comment


                #97
                The main reason why i'm trying to find a better solution to how i did it is that i had to switch to a tiled underwater terrain with world composition, initially my water surface was sitting at Z 0.0, world composition doesn't allow me to lower my terrain so i had to re-do my entire coding and raise my entire scene to match the new height, the whole absorption post process had to be re-adjusted to really high values since my surface is now around Z 55,000, being able to mask the effect would look much better too

                Comment


                  #98
                  Actually i figured it out, here's an example



                  Comment


                    #99
                    There is a way to "cut" the post process material too see half underwater? Like this?

                    Comment


                      Originally posted by Kheka View Post
                      There is a way to "cut" the post process material too see half underwater? Like this?
                      This is something I've had trouble with other than using 2 post process volumes that meet at the middle around the character/boat/etc.
                      Tek LLC a personal Candaian Company running BlenderTek & UnrealTek is currently looking for help to bring back submarine simulator gaming with a new genre of sub sims: Cold War! (1945-1991) Operation: Trident SubSim Dev Diary Thread - Donations

                      Comment


                        Originally posted by Nsomnia View Post
                        This is something I've had trouble with other than using 2 post process volumes that meet at the middle around the character/boat/etc.
                        RyanB covers it above, but here's a quick example of how to do it with one volume. Assuming a water plane at z=0, This projects a plane, perpendicular to the camera view, 10 world units ahead. Then it checks if the intersection of each view ray and this plane has a z value less than 0. If it is, the post process is applied, if not, it returns scene texture. If your water plane material has some z world offset then check the intersection z value against that.

                        Click image for larger version

Name:	SplitViewPP.png
Views:	1
Size:	263.6 KB
ID:	1100690

                        Comment


                          Originally posted by xnihil0zer0 View Post
                          RyanB covers it above, but here's a quick example of how to do it with one volume. Assuming a water plane at z=0, This projects a plane, perpendicular to the camera view, 10 world units ahead. Then it checks if the intersection of each view ray and this plane has a z value less than 0. If it is, the post process is applied, if not, it returns scene texture. If your water plane material has some z world offset then check the intersection z value against that.

                          [ATTACH=CONFIG]79052[/ATTACH]
                          Great Blueprint! Thank you for sharing! Can you explain the last part "If your water plane material has some z world offset then check the intersection z value against that". I was able to follow your BP but when I added an ocean world displacement the PP_splitplane material is not following the water displacement as you mentioned.

                          Comment


                            Originally posted by Arnage View Post
                            The alpha blend tends to work good enough at an angle, but straight on you might need something more indeed. That dying light example is an interesting approach. A bit dark, but that wouldn't be a big issue in your case as your scene is quite dark anyway. I couldn't resist to prototype it a bit, here's a material function to create such a mask that you could use in the glass material of your helmet to create a similar effect:

                            [ATTACH=CONFIG]23695[/ATTACH]
                            How you made it waving? mine stays as a simple line

                            Comment


                              This is relevant:
                              https://en.wikipedia.org/wiki/Underw...t_diagram3.jpg

                              The same article states the visibility distance in clear ocean water is 74m.
                              Last edited by duke22; 01-24-2018, 02:15 AM.
                              George Rolfe.
                              Technical Coordinator at Orbit Solutions Pty Ltd.

                              Comment


                                Using Arnage's method, has anyone tried to implement underwater refraction for the water surface? I am using an inverted plane from my water surface with refraction enabled so that I can get refraction when underwater and looking up at the world outside of my water body. But it seems that the distortion is not being applied properly and not taking the PP fog into account. I've been trying to solve this for days now but to no avail.

                                Here's what I am expecting the distortion to look like when underwater (combined with the fog PP effect ideally, but it's not enabled in this screenshot):

                                Click image for larger version

Name:	Screenshot_2.jpg
Views:	42
Size:	136.1 KB
ID:	1505784

                                And here's what it looks like with the PP enabled:

                                Click image for larger version

Name:	Screenshot_1.jpg
Views:	39
Size:	55.3 KB
ID:	1505785

                                Any input or pointer would be greatly appreciated.

                                Thank,

                                Comment

                                Working...
                                X