Announcement

Collapse
No announcement yet.

Underwater depth light fade to dark!

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

    Underwater depth light fade to dark!

    Hi there,

    I have made a ocean with a water plane and a post process volume for the underwater effect. And it all looks nice, but I am haven serious problems trying to make the effect to have the light fade to dark as it gets deeper in the ocean.. So not as you go deeper, but can see it getting dark from a distance.

    I have tried with Exponential Height Fog and could not work it out. Any help would be great, or a example.

    Thanks, Steve
    Last edited by ZeroVector; 06-16-2018, 04:59 PM.

    #2
    Hey Steve,

    For the darker "deep" water effect when looking down from above you will need to add a depth fade node with a scalar parameter to drive a Lerp between deep and shallow colors to your translucent water material. I have an example of this in the ocean project linked in my signature below but it's a really complex material, so I put together a quick example of how it's used:

    Click image for larger version

Name:	DepthFade.JPG
Views:	52
Size:	369.0 KB
ID:	1490315

    I created the adjustable variables as parameters rather than hard coded values, this way you can create a material instance to get the right settings for your project. To control how deep the water needs to be before you can no longer see the bottom adjust the FadeDistance parameter, and to adjust how smooth the transition is you can increase the FadeSoftness parameter.

    That's pretty much it for this effect when looking down from above, but won't do anything below the surface.

    This is a very basic implementation of it, but should do what you need. Here's what it looks like with a similar technique in the ocean project:

    Click image for larger version

Name:	DepthFade2.JPG
Views:	54
Size:	571.1 KB
ID:	1490316

    In this image I'm actually using 2 different depth fades, one for the deep to shallow water, the other for the shallow to very shallow water. I'm in the middle of some big changes to this material so it doesn't look as good as it should right now, but with with enough adjustment you can get it looking just right.

    Hope that helps!
    Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

    Comment


      #3
      Thanks DotCam, yes I have looked at the Free Community Ocean & Sky Project in the past few months and have the project in my UE4. It's great, but I am using the new Voxel Plugin and i cant map the ocean to the voxel terrain in the setting only allows ue4 terrains.. I tried making a ue4 terrain with a height map which mirrors the voxel terrain to use in the ocean details panel but was very taxing using both voxel and ue4 terrain lol.. God i hope that makes sense lol.. I am new to this.. I only a web developer but did game dev back on the Amiga with Amos back in the day.. oh so old days lol... But starting to get into UE4.. Need a change, been doing web dev since the late 90's LOL

      I am using the Beach Wave Water from the market for the surface which works nice for my islands and the Ocean Floor Environment also from the market.. But the Ocean Floor Environment uses a post processing volume. Is there away to use those nodes with the post processing volume which i am using for the underwater effect? Sorry for being a newbie, but u can see in my screenshot I am learning lol..

      Comment


        #4
        If you mean looking from above the surface then you will need to add the DepthFade node hooked up to a Lerp to control the light and dark boundary as shown in my previous post to your ocean material. I do not have access to that asset so I'm not able to give a proper example, but that is the general idea.

        If you mean light/visibility level decreasing the lower you go underwater (while viewing underwater) we tried a few different approaches but ended up using a post process material that becomes active once below the surface.

        This is an example of that, but I am pretty sure you mean looking from above
        https://gyazo.com/ed348d70452d9164f390d98df540bca4

        The post process volume for underwater effects does not have any affect on the look from above the surface, it is only there for when the camera goes beneath the surface.
        Last edited by DotCam; 06-18-2018, 02:43 PM.
        Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

        Comment


          #5
          Oh yes that is what I want when the player is underwater.. Sorry I think I confused things, I should of left out the Beach Wave Water which is only surface.. Yes sorry in the post process material is what I am after, I already have a post process volume being used for the existing underwater effect, i just need the "light/visibility level decreasing the lower you go underwater".. Sorry, can you help on this, I'm not sure how to do a post process material... That video is great, I seen the effect in the project I downloaded from "Free Community Ocean & Sky Project".. It's what got me thinking it was a post process effect, but was not sure how...

          Comment


            #6
            Hi there, Yes I did mean light/visibility level decreasing the lower you go underwater in a post process.. But I have no idea how to do it.. I have tried for a few hours.

            Comment


              #7
              Originally posted by ZeroVector View Post
              Hi there, Yes I did mean light/visibility level decreasing the lower you go underwater in a post process.. But I have no idea how to do it.. I have tried for a few hours.
              I'll try and put together a quick example for you later this afternoon, have a few things I need to finish up first. It will basically be a stripped down version of the post process material currently in our project, there are a few things specific to our project that aren't necessary. Will post again later when it's done.
              Free Community Ocean & Sky Project || Join us on Discord! || Trello Roadmap

              Comment


                #8
                Originally posted by ZeroVector View Post
                Hi there, Yes I did mean light/visibility level decreasing the lower you go underwater in a post process.. But I have no idea how to do it.. I have tried for a few hours.
                Just have the level BP track the player character and just have a function that lerps between all of the various settings that you want to change within the post process volume. Set min and max depths. If you go deeper than the max depth, it will have no further effect. Calculate a percentage based on your min/max values and that will be used to drive the lerpfest.

                Comment


                  #9
                  Originally posted by DotCam View Post

                  I'll try and put together a quick example for you later this afternoon, have a few things I need to finish up first. It will basically be a stripped down version of the post process material currently in our project, there are a few things specific to our project that aren't necessary. Will post again later when it's done.
                  Thank you this would greatly help me and also help me to learn, so next time will not have to ask

                  Comment

                  Working...
                  X