Underwater with Verasl Water System

Hi, I’m using the water system from the BoatAttack demo and in general I want to add underwater effects, and there was a problem.

How to make underwater effects in this case?

Doesn’t anyone really know how to implement this?

A forward render feature with basically a shader that tints everything blue or increase the fog below a certain world position y.

1 Like

It will turn out crooked, need an effect like in the video

https://www.youtube.com/watch?v=FE6l39Lt3js

I have already tried to implement this, but knowledge of shader coding is very lacking :slight_smile:

I already have post-processing underwater, but here’s how to make it depending on the wave I don’t know

Well, nobody will give the solution of a 50$ water asset for free. If it’s too complicated, I advice you buy an asset or hire a graphics programmer. :slight_smile:

The solution with checking the world position y works fairly well, as long as you don’t have high waves, e.g. a uniform ocean surface. But yes, anything more advanced requires more work. :slight_smile:
You need to know the world position y of your waves and feed that information into the shader with textures so the shader can evaluate the water position y depending on the position of your wave grid. But I think a seamless transition would require a custom stencil buffer.

Screenshot with a solution in URP for low-end mobile.

I am a beginner with shaders but what I think you can do is to check if the y position of each pixel is below the water surface, and if it is not, then discard it

You can use stencil buffer (using water plane as mask) then in underwater postprocess pass apply effect to every pixel not masked out by stencil.

Can you post code or a unitypackage for a version of this? Been trying to figure this out forever.