This is a waterfall/river asset in Unreal Engine 5, that can take in arbitrary geometry as input and produce foam when blocked by scene actors, and flow obstruction (transparency) at steep slopes. Additionally, Niagara particles simulate splashes where objects intersect with it.
Breakdown:
First the geometry is flattened by its UV coordinates using a vertex offset in material, this way ensures the entire geometry will be visible to the scene capture component regardless of shape. Then we sample distance fields from the original world position and write that to a render target.
The shader does a basic simulation that involves shifting the density field (render target) in the direction of flow, decaying the density as it ages, and adding density where there is a change in slope.
The render material takes in this render target and interpolates opacity and foam based on slope and how “fresh” the foam is.
Niagara particles emitted from the water geometry add splashes where they collide with actors in the scene. Their initial velocity is derived from the mesh bitangent and flow direction. They are only rendered when a collision occurs to minimize overdraw.

Splish, Splash!

Potential optimization opportunity: the scene capture part could be run just once and world positions stored in a lower resolution render target. Then use that as input to the material that samples the world positions continuously and draw it to a render target using blueprints at a significantly lower tick rate.

You may also like

Back to Top