Water Cut off Effect

Hi,

Working on a side scroller game and I need to create a water cut off effect like seen in the screenshot of Ori and the Blind forest.

Basically need a side perspective on water bodies like lakes and ponds where I can see objects underwater as well as above water. Water may be subject to ripples and disturbances (caused by player or fish swimming in the water).

Thanks

There are a lot of tutorials on how to make realistic or at least believable water like this one: UE4 Tutorial: How Make Water Material in "Starter Content" Work Without Stretching or Distortions

To get the cut you can adjust the camera clipping plane by opening Edit → Project Settings → General Settings → Near Clip Plane.

Now hoe to apply different shades above and below the water line - I can’t help you here.

What you suggesting is regular water shader. I get that and If i use clipping, wouldn’t that just clip the horizontal water plane. It wouldn’t generate a vertical slice for me to get that partial underwater level. Its just empty under the surface.

  1. Render water into custom depth
  2. For a side view, make and position a plane, so that its top vertices position match water plane vertices.
  3. Make a material for the side view plane, unlit translucent one, that displaces its top vertices with the same function, water plane is displaced, samples scene texture and applies amount of fog, proportional to the distance between pixel and scene depth or custom depth, whatever is smaller.
  4. Optionally, add a line to hide transition from water plane to cut plane. Can be done as a separate mesh or effect both in water and sideplane materials.
  5. Profit.

Yep. The cut off will just cut the water plane. Nothing more.

The bottom part would probably be empty in all cases. However there are a lot of sharers applied in the bottom in the picture and probably additional geometry/shaders to make the thin waterline (called meniscus).

Rendering above/below water is not a trivial task.

I asked this question to Antoine Louisia, his answer -

“The mesh i used to create this water is a cube, and i added vertex color (G Channel) only on the top of this cube. This way, you get a mask that you may use for the displacement and the foam (not for the color), so it doesnt affect the sides of your cube. They may be a lot of other ways to achieve this, but this one works perfectly fine !”