[Community Project] FREE Ocean Water Shader

@script526

Depth Fade would do the trick, but won’t work on all scenarios, meaning different tweaks for one material (ocean material) which you would need to activate depending where you are in the scene.

DistanceToNearestSurface works fine for postprocess and underwater (since you can stack material instances at the postprocess with different objects to mask). For the ocean material, simple things like a boat when moving the camera far from it, will generate tiny numbers and the water will fill the interior again. It would work for an interior the the length of flooded area is not too big, otherwise you will see water appearing as artifact. Distance Fields by default is low resolution and you would need to setup each mesh with a better one for tweaking, meaning a lot of work.

The best possible solution is with stencil, it would give less work in general and the result is the expected elsewhere, it is more difficult to set, so I will work on some changes in the project, and make a video showing how to use this solution. I think it is in the best interest for people how the solution is done, instead of giving it done in the code already, so people have the chance to learn in the process. I will do the same approach as the foam wakes, showing the issue and where to change in a step-by-step.