User Tag List

Results 1 to 16 of 16

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

  1. #1
    0
    Samaritan
    Join Date
    Oct 2015
    Posts
    99

    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.
    Name:  898897e253e38a5aac9517b0f32cad31.png
Views: 377
Size:  555.0 KB

    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 at 03:31 PM.

  2. #2
    0
    Unreal Engine Developer
    Join Date
    Apr 2014
    Posts
    1,856
    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:

    Name:  C698nz7XAAQvyOa.jpg
Views: 316
Size:  32.1 KB

    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

  3. #3
    0
    Samaritan
    Join Date
    Oct 2015
    Posts
    99
    Quote 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:

    Name:  C698nz7XAAQvyOa.jpg
Views: 316
Size:  32.1 KB

    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?

  4. #4
    1
    Unreal Engine Developer
    Join Date
    Apr 2014
    Posts
    1,856
    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

  5. #5
    0
    Samaritan
    Join Date
    Oct 2015
    Posts
    99
    Quote 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!

  6. #6
    0
    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?

  7. #7
    0
    Quote 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.

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

  9. #9
    0
    Unreal Engine Developer
    Join Date
    Apr 2014
    Posts
    1,856
    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:

    Name:  stuff.JPG
Views: 219
Size:  17.4 KB

    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

  10. #10
    0
    Quote 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

  11. #11
    0
    Quote 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:

    Name:  stuff.JPG
Views: 219
Size:  17.4 KB

    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!!!

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

  13. #13
    0
    Quote Originally Posted by Kalle_H View Post
    Post process effect can be rendered before transparent.
    Got it. Thanks

  14. #14
    0
    Quote 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:

    Name:  stuff.JPG
Views: 219
Size:  17.4 KB

    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 ?

  15. #15
    0
    Unreal Engine Developer
    Join Date
    Apr 2014
    Posts
    1,856
    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

  16. #16
    0
    Quote Originally Posted by RyanB View Post
    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.
    Sorry, my English is not good! Anyway, thanks your reply

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •