Announcement

Collapse
No announcement yet.

Under water / above water split view, is this possible?

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

    #31
    This are my materials which works with Ryan's method. (PostProcess + Translucent)
    Attached Files

    Comment


      #32
      Hey I recently was searching for this technique too, and found a ton of really great info in this other, related thread https://forums.unrealengine.com/show...-this-possible

      Hope it helps!
      @Brian__May

      Comment


        #33
        Originally posted by BrianMay View Post
        Hey I recently was searching for this technique too, and found a ton of really great info in this other, related thread https://forums.unrealengine.com/show...-this-possible

        Hope it helps!
        Useless, the issue is when you add a displacement to the water plane

        Comment


          #34
          I am not sure what you mean. He just posted that link for reference since it covers some similar issues. Just various ways of handling specific masking issues.

          isn't your issue with displacement resolved now?
          Last edited by RyanB; 05-30-2017, 07:07 PM.
          Ryan Brucks
          Principal Technical Artist, Epic Games

          Comment


            #35
            Well yes and no, because you need a high tessallation/poly mesh, i was thinking to move it to a depth/stencil to gain some performance (or using that might get worse performance)..
            anyway, even tho, i write the water mesh to depth/stencil and there i am stuck, i can't find a way to get near depth position and then fill rest of screen under it ...
            can you give a hand Ryan?

            Comment


              #36
              Originally posted by RyanB View Post
              You shouldn't do Sine of AbsWorldPos.x , you should use the ScreenPosToWorld for all the world positions there. The sky distance should never come into play.

              Should be more like this

              Z mask = ScreenPosToWorld.z - WaterHeight + Sine(ScreenPosToWorld.X + Frac(Time)))
              Yeah, it works. Thank you Ryan!

              Here is very basic setup with sine waves:

              Click image for larger version

Name:	2017-05-31_1057.jpg
Views:	1
Size:	128.0 KB
ID:	1128883


              Click image for larger version

Name:	2017-05-31_1047.jpg
Views:	1
Size:	13.4 KB
ID:	1128882
              Last edited by redbox; 05-31-2017, 03:59 AM.
              Rocketeer

              my portfolio
              my youtube

              Camera Volumes System
              Instanced Plugin
              Simple Portals
              Water Flow For UDK
              Setup Swarm

              Comment


                #37
                Actually, even with high poly/tessellated plane, the waves from PP just don't match the water mesh

                Comment


                  #38
                  In post process material you would need to perfectly mimic the triangulation of the water mesh and then correctly calculate ray intersection with it per pixel. This is just not doable.

                  Comment


                    #39
                    Actually, is quit easy with stencil, you create a box with inverted faces apply water material on it, write to stencil only and get water split line.Click image for larger version

Name:	water.png
Views:	1
Size:	378.4 KB
ID:	1129057

                    Comment


                      #40
                      To expand on what some3one3 said, grab your water plane, rotate it 180 degrees so it faces down, assign an opaque material, tell it to write to a custom stencil, give it id 1. Add a flipped face "bucket" that contains your water, give it id 1 as well. Tell both of these objects not to render in the main pass, then mask your post effects in a material by stencil! This way it includes any displacement on your water plane.
                      George Rolfe.
                      Technical Coordinator at Orbit Solutions Pty Ltd.

                      Comment


                        #41
                        Originally posted by duke22 View Post
                        To expand on what some3one3 said, grab your water plane, rotate it 180 degrees so it faces down, assign an opaque material, tell it to write to a custom stencil, give it id 1. Add a flipped face "bucket" that contains your water, give it id 1 as well. Tell both of these objects not to render in the main pass, then mask your post effects in a material by stencil! This way it includes any displacement on your water plane.
                        Exactly
                        But i still didn't find a way to add that cool line effect like in GDC
                        Anyone have code/ideea for that?

                        Comment


                          #42
                          Hi Everyone, i'm trying to achieve the water line as well, and i'm almost there (i think) but i have a big problem.

                          I'm using this method, but the noises of the two materials don't match.
                          Originally posted by som3on3 View Post
                          This are my materials which works with Ryan's method. (PostProcess + Translucent)
                          This is my situation:


                          Any suggestion to get these lines aligned?
                          Thanks!

                          Comment


                            #43
                            Originally posted by Alessiana View Post
                            Hi Everyone, i'm trying to achieve the water line as well, and i'm almost there (i think) but i have a big problem.

                            I'm using this method, but the noises of the two materials don't match.

                            Any suggestion to get these lines aligned?
                            Thanks!
                            I said above, using custom depth with stencil was best method i could find at that time, tho i am testing different methods now to see if i get better results

                            Comment


                              #44
                              Seems that there is a major bug with ScreenPosToWorld (in MacOS at least, haven't tested under Windows)
                              if you open a Material Instance, that function will return wrong values and the line separation will no longer work.
                              Tho, if you open a standard material, function will work as wanted. Maybe RyanB or someone else can look into this issue.

                              Comment


                                #45
                                Originally posted by som3on3 View Post
                                Seems that there is a major bug with ScreenPosToWorld (in MacOS at least, haven't tested under Windows)
                                if you open a Material Instance, that function will return wrong values and the line separation will no longer work.
                                Tho, if you open a standard material, function will work as wanted. Maybe RyanB or someone else can look into this issue.
                                working fine on windows for me, currently using it with above water hlsl sharpening, underwater hlsl fog hlsl Gaussian blur and screen distortion as well as the waterline.

                                Edit: forgot to mention im using material instances for all of them.
                                Edit2: i just played around with it in another project, and had offset problems so i checked the near clip plane and for reasons unknown to me it was set to 3 and not 10, though i have never had reason to change it.
                                Last edited by ixicalibur; 07-03-2018, 08:38 PM.
                                CEO of Prydetech

                                https://www.artstation.com/ixicalibur

                                Originally posted by ixicalibur
                                Here you go, this is a link to every tutorial you could ever need plus instructions to access all the collective knowledge of mankind: [Super massive awesome link that every amazing game developer uses to instantly learn to be super awesome at making stuff]

                                Comment

                                Working...
                                X