ShallowWaterRiver and Landscape

Hello,

I created a river using WaterBodyRiver, added the ShallowWaterRiver, clicked on ‘reset’… Waited for the water to complete the spline path, clicked ‘Bake’, and then changed the Render State to ‘Water Component with Baked Sim’.

Curiously though, it creates a ‘water wall’ that disappears as I get closer to it. This doesn’t happen along the entire course of the river, only in a few spots.

What could be triggering this? I already tried to change the spline trajectory, reshaped the landscape with brushes but it always come back in a different location of the river. :frowning:

Thank you guys!

Solved / Workaround found (UE 5.8)

I managed to track this down to the baked simulation height sampling in MF_ShallowWaterRiver.

The vertical water wall was coming specifically from the SW_WaterHeight path used by the river WPO. The baked simulation UV (SW_FluidTextureUV) can reach exactly 0 or 1, while the bilinear sampling logic accesses neighboring texels. At the texture boundaries this can result in out-of-bounds edge sampling and produce an invalid/discontinuous water height. That value then reaches the WPO and stretches some river vertices vertically, creating the huge wall.

As a test, I first clamped SW_FluidTextureUV to 0.001 – 0.999 before both MF_ShallowWaterRiver_BilinearInterp nodes. The wall disappeared completely.

I then replaced that test with a resolution-independent half-texel clamp:

HalfTexel = 0.5 / TextureSize

MinUV = HalfTexel

MaxUV = 1.0 - HalfTexel

SafeUV = Clamp(SW_FluidTextureUV, MinUV, MaxUV)

SafeUV is then connected to the UVs input of the baked simulation bilinear interpolation.

For the normal baked texture path, I get TextureSize from BakedWaterSimTex using a Texture Property node set to Texture Size.

After applying this change, I did a full Reset → simulation → Bake again and tested the river at different camera distances and along the entire spline. The wall did not return.

So, at least in my case, this was not caused by Water Mesh tiles, the river spline, Gerstner waves, simulation resolution, or the bake itself. It was caused by sampling the baked height texture at its exact UV boundaries.

Important: MF_ShallowWaterRiver is part of the Engine’s experimental Water Advanced plugin, so modifying it directly can be overwritten by an Engine Verify/update. I currently keep the modified .uasset as a project-side engine patch and reapply it when necessary.

Hopefully this helps anyone running into the same issue.

(In the section “Baked sim sampling” of the Material Function “MF_ShallowWaterRiver”)