Announcement

Collapse
No announcement yet.

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

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

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

    Hi,

    I was wondering if anyone knows of some way to split post process effects over two halfs of your camera. I've been watching the new fluid simultations videos on the community hub and everytime they showcase water they have this insanely beautiful transition where your camera is at some point showing above water and the lower half is showing the underwater. They seem to have two seperate post process effects active and have them split by a mesh. This looks really really cool and I would kill (not really lol) to get this effect in my game project (signature).

    Here is a screenshot I took from the fluid simulation by render target video.
    Click image for larger version

Name:	898897e253e38a5aac9517b0f32cad31.png
Views:	1
Size:	555.0 KB
ID:	1213415

    Oh Unreal lords, please share your knowledge. I just need to have this in my project. xD

    Cheers.

    EDIT: Waaiiit a min.... Are they using a atmospheric fog for this? And just setting the altitude value at exactly the height of the water surface? Meaning it's fake? Please tell me I'm wrong. Tell me there is some magical trick to do this.
    Last edited by WixZ; 03-20-2017, 03:31 PM.


  • #2
    I did that material by using the world position of the near clip plane. Since doing screenpos-> transform caused a crash I had to create a custom node to do it. I have an image from my twitter feed where somebody asked this same question:

    Click image for larger version

Name:	C698nz7XAAQvyOa.jpg
Views:	1
Size:	32.1 KB
ID:	1124973

    Note that the 10 is hardcoded to match the default near clip plane. In VR editor the near clip plane changes based on world to meters scale. There is a way to access the frame's actual near clip if you need that but I will have to search for it later.

    No atmospheric fog. Just manual shader fog using scene depth.
    Ryan Brucks
    Principal Technical Artist, Epic Games

    Comment


    • #3
      Originally posted by RyanB View Post
      I did that material by using the world position of the near clip plane. Since doing screenpos-> transform caused a crash I had to create a custom node to do it. I have an image from my twitter feed where somebody asked this same question:

      [ATTACH=CONFIG]134062[/ATTACH]

      Note that the 10 is hardcoded to match the default near clip plane. In VR editor the near clip plane changes based on world to meters scale. There is a way to access the frame's actual near clip if you need that but I will have to search for it later.

      No atmospheric fog. Just manual shader fog using scene depth.
      Thanks for answering yourself Ryan. I kind of semi-understand your approach. Not entirely sure how the near clipping planes gives you the water surface and how you apply a fog beneath it though. Or did you just hardcode it at a certain height? Which would mean it will not work at all with displaced water?

      Comment


      • #4
        It gives you the world position to then access anything else you need. The start is to subtract the water Z, and then you add whatever displacement. You can map a world aligned texture to the world position of the screenpos and then use the result to offset the water Z. Then you have a black and white mask to blend between whatever you end up doing underwater and the raw SceneTexture for above water.
        Ryan Brucks
        Principal Technical Artist, Epic Games

        Comment


        • #5
          Originally posted by RyanB View Post
          It gives you the world position to then access anything else you need. The start is to subtract the water Z, and then you add whatever displacement. You can map a world aligned texture to the world position of the screenpos and then use the result to offset the water Z. Then you have a black and white mask to blend between whatever you end up doing underwater and the raw SceneTexture for above water.
          Sweet. I will definitely give this a try. I hope to God I can make it work. Would be so awesome. Thanks for the info!

          Comment


          • #6
            Hey, I have a slightly off-topic question:
            Ryan, you helped me earlier with the underwater fog. Which was really nice.
            However, Translucent sprites (Bubbles for example) that are near are occluded by this Fog. Is there a possibility to avoid this?

            Comment


            • #7
              Originally posted by Raildex_ View Post
              Hey, I have a slightly off-topic question:
              Ryan, you helped me earlier with the underwater fog. Which was really nice.
              However, Translucent sprites (Bubbles for example) that are near are occluded by this Fog. Is there a possibility to avoid this?
              Normal fog and transparency works in this order. Opaque -> Fog -> Transparents with vertex fog.
              So you just need to make sure that bubbles are rendered after water and then you need to reapply water fog to your bubbles at material level.

              Comment


              • #8
                Are you guys going to share any material from gdc presentations? It would be very very nice to have! Thanks!

                Comment


                • #9
                  I have been preparing it, but it has been going a bit slower than I expected. The main reason is that I am using some of this stuff in various game branches now and my changes I make there are not backwards compatible with the 4.14 version I am also polishing before release. So every few days I have to go back to the 4.14 version and redo my changes there. I still have materials to clean up but so far this is what the plugin is looking like:

                  Click image for larger version

Name:	stuff.JPG
Views:	1
Size:	17.4 KB
ID:	1125011

                  The caustics stuff will be a lot harder to separate out so that will probably come much later.

                  Originally I was going to break this into 4 or 5 separate packs, but it has turned out many of the functions are re-used across them all so I think I am just going to group them together like above. Might name it something more general like ShaderBits GDC Pack 1 or something.
                  Ryan Brucks
                  Principal Technical Artist, Epic Games

                  Comment


                  • #10
                    Originally posted by Kalle-H View Post
                    Normal fog and transparency works in this order. Opaque -> Fog -> Transparents with vertex fog.
                    So you just need to make sure that bubbles are rendered after water and then you need to reapply water fog to your bubbles at material level.
                    The Fog is a post Process though

                    Comment


                    • #11
                      Originally posted by RyanB View Post
                      I have been preparing it, but it has been going a bit slower than I expected. The main reason is that I am using some of this stuff in various game branches now and my changes I make there are not backwards compatible with the 4.14 version I am also polishing before release. So every few days I have to go back to the 4.14 version and redo my changes there. I still have materials to clean up but so far this is what the plugin is looking like:

                      [ATTACH=CONFIG]134157[/ATTACH]

                      The caustics stuff will be a lot harder to separate out so that will probably come much later.

                      Originally I was going to break this into 4 or 5 separate packs, but it has turned out many of the functions are re-used across them all so I think I am just going to group them together like above. Might name it something more general like ShaderBits GDC Pack 1 or something.

                      Wow!! thank you so much!!!

                      Comment


                      • #12
                        Originally posted by Raildex_ View Post
                        The Fog is a post Process though
                        Post process effect can be rendered before transparent.

                        Comment


                        • #13
                          Originally posted by Kalle_H View Post
                          Post process effect can be rendered before transparent.
                          Got it. Thanks

                          Comment


                          • #14
                            Originally posted by RyanB View Post
                            I have been preparing it, but it has been going a bit slower than I expected. The main reason is that I am using some of this stuff in various game branches now and my changes I make there are not backwards compatible with the 4.14 version I am also polishing before release. So every few days I have to go back to the 4.14 version and redo my changes there. I still have materials to clean up but so far this is what the plugin is looking like:

                            [ATTACH=CONFIG]134157[/ATTACH]

                            The caustics stuff will be a lot harder to separate out so that will probably come much later.

                            Originally I was going to break this into 4 or 5 separate packs, but it has turned out many of the functions are re-used across them all so I think I am just going to group them together like above. Might name it something more general like ShaderBits GDC Pack 1 or something.
                            Well, where can i download it ?

                            Comment


                            • #15
                              If you read my post, I was pretty clear that I am still preparing it and its a lot of work. Sometime in the next week or two is my goal.
                              Ryan Brucks
                              Principal Technical Artist, Epic Games

                              Comment

                              Working...
                              X