I have this river going into a lake and for the most part it works fine. But on the edges the transition just absolutely craps out for some reason. Its almost like it cant handle touching the landscape or something. Any way to fix this?
Hello there @FloatingPebble!
That’s strange, the jagged edges in your water only appear when clashing with terrain, and not when interacting with the other two water bodies (unless they do in the area underneath). So, I would say this is more related to that particular water body, or the terrain itself. Let’s cover this step by step:
-
First, test by rebuilding the affected water mesh, either by picking the transition actor and moving it from position, or forcing it with cmdlet r.Water.WaterMesh.ForceRebuildMeshPerFrame 1
-
Check your landscape’s geo for any sharp height changes that could affect the transition, smooth out the shoreline if possible
-
Also, review the priority values for all your water bodies, as the edges can be the result of either the lake or the river fighting to show up on top the transition body from below, turning it unstable
-
Test by temporary disabling the “Affects Landscape” check in your water bodies (first the lake/river, then the transition)
-
Finally, following a similar thread from the community, I would also suggest increasing the landscape’ resolution, while adjusting the falloff values on the transition’s water heightmap
Right so I tested all these suggestions:
- That didnt work at all. It just rebuilds with the same edge.
- I completely rebuilt the landscape to have 20x more resolution (and even smoother transitions) just to test if thats the issue and it was still producing the same edge.
- Did nothing.
- Also does nothing to remove the edge.
What I did notice is that its only the shallow water body river thats causing this. If I switch to the regular spline river, not the simulated one, then it works just fine.
It seems to have the most issues where the transition mesh intersects the landscape splines height.
I figured out that the problem is coming from the shader so I decided to investigate further.
The shader is deforming the World Position Offset of the water thats under the landscape to match the landscape height. And then the material is using Opacity Mask Clip Value to clip it based on a mask that gets generated inside the shader. Normally it should work just fine, but because the WPO is being adjusted to the landscape height, it clips it wrong.
So my solution is that I dont need the shader to match my landscape height at the edges of the mesh. It should just clip it.
Solution: If you go into a material function (search for it) called MF_ShallowWaterRiver and then under the WPO computation commented section there is the custom material expression code which looks like this:
if (Opacity < 1e-8 && RenderSplineMesh > 1-1e-5 && SplineWaterDepth > 1e-5 && 0)
{
return WPO_Spline;
}
else
{
return WPO_Sim;
}
So just remove the if statement line so it looks like this:
return WPO_Spline;
You can also just bypass the node entirely and connect the WPO_Spline to the world position offset further down the line.
And there we go. We are no longer offsetting the water mesh thats under the landscape to the landscape height which then gets correctly clipped by the opacity mask clip.


