Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Water transition from surface to underneath

Discussion in 'High Definition Render Pipeline' started by ImperialDragon98, Jan 31, 2020.

  1. ImperialDragon98


    Nov 7, 2018
    Currently i'm making a game with the latest hdrp update, unity 2019.2.17f1. My end goal is to achieve a water transition like this screenshot. How did Subnautica have the underwater effect only affect the portion of the screen that is under water. Would you build this with a shader if so please answer in shader graph format? Some help getting this started would be very appreciated.
  2. Bezoro


    Mar 16, 2015
    The underwater look is usually done via post processing. But it's a tough nut to crack.
    In fact, if you notice, most games don't have a good implementation, they either hide the transition from over the water to underwater or they just say screw it and you can clearly see when the post processing change happens.
    The first game with a really good implementation that I noticed was Far Cry 3, looking into it I discovered that the underwater look is done via post processing, and it is masked by the waves position on the screen.
    So you have 2 post processing layers happening, one for the game over the water and one for the game underwater, when you position the camera in such a way where you can see half of each, like in your screenshot, these post processing effects are masked by the waves position on screen so that the underwater look doesn't bleed outside or the other way around.

    I have not used the shader graph yet so I don't know it's limitations, but if you can create a custom post processing material with it, kind of like you do in UE4 if you are familiar, and get the position of vertices of a mesh, (the water surface), you could in theory do it.
    MaxHerrmann likes this.