You could do this in a blueprint by creating a float variable in the underwater control blueprint and connect it as the output from a MapRangeClamped(float) node that outputs a 1-0 scale multiplier based on the ocean surface Z height (multiplier = 1) and the Z height level for when you want no lighting to be visible, say -500m underwater for example (multiplier = 0). You’d then input the controlled character or vehicle’s current WorldLocation.Z height value and then multiply the current LightIntensity by the output of this node to automatically adjust the sun light intensity (and sky light, all lights really). In the image below the arrow is pointing at the lower end of the scale, as in how far below the surface should be pitch black, adjust this to your own preference.
I run the [Community Ocean and Sky Project][2] over on the forums and we used a similar technique outlined in the images posted above for underwater in our PostProcess material, however we also uses both the stencil and depth buffers, and perform the sun intensity manipulation within the material itself. Feel free to download the project and have a look at:
Ocean\Materials\Underwater\M_Underwter_PP and Ocean\BP_Underwater
to see how we wen’t about it. If your game will be mostly below water it could give you a better look doing it through blueprint since you are removing all light rather than hiding it. This way you can focus your PP material on the look you want while deep underwater with a flashlight/headlamp, rather than needing to fade out the sun as well.
