Pros:
-Is realistic
-Is render-effecient
-Is easy to make
Cons:
-Does not work underwater
-Is not animated (can be done though)
-Requires the seabed to be textured in a specific way (see tutorial), so the shader won’t work right off the bat.
I had done a similar method for a previous project, where i think i used an empty object as a UV projector for a shading ramp for any objects that dip below the water line. using the projector allows objects to animate in and out of the water, and you can use the same projector for consistent shading with multiple objects (ground, boats, etc).
another good solution i recently found was a light path/ray-length node setup, which checks if an object is being viewed through the water (“is transmission ray”), and then applies a shading ramp according to the ray length. this is the most flexible since it doesn’t require a flat water surface, and also shades more realistically since its view dependant, and not just a vertical depth calculation.
It is using the ray length from the camera, and because of that it just becomes white as you zoom away from it. I’m not sure how to use the “is transmission ray” to check if it underwater. Please explain
Not at a blender computer right now, I’ll share a blend later, but the trick I discovered was that the shading has to happen on the objects in the water, not the water itself. It’s a little tedious, but you can make a node group out of it and apply it to numerous objects. The basic setup is to take the diffuse colour of the object, and multiply it by a ramp controlled by Ray length (like you’ve done), but to only use transmissive rays (basically multiply ‘is transmission ray’ and ‘ray length’)