How to hide water in objects UE5

In my case, only water is hidden at the edges of the box

Hi Kesuex,

Take a look at this community tutorial. I think he’s showing one way to accomplish what you’re asking.

Cheers.

Hello, thank you, but this method does not quite suit me

I recall the another method involving stencil masking, but have never implemented it myself and am unsure if things have changed in UE5.

Two methods are described there, as far as I understand, the first one does not fit because there are no necessary parameters in the UE5, and I also use the second method with the DistanceToNearestSurface node, but the result I sent is obtained

The only real way is a double mesh with depth stencils enabled.

Do you have any examples of how to apply this method? I would be very grateful.

Tutorials no.

Basically you make 2 meshes, or separate the mesh you have in 2 so that there is 2 meshes.

You make the inside mesh render over the water using the stencil.
The outside mesh is left alone.

If your inside mesh has edges that go all the way to, well… the edge, you won’t notice artefacts.

If it doesn’t, its likely you’d see water from waves and such cutting into the edge.

I don’t exactly remeber, but I do believe you need to modify the water material to output transparency over the stencil value.

Start out with any Custom Depth stencil tutorial so you understand the basics of the system first.

Thanks for the info