Hey Unreal Devs!
We wanted to share how we created a stylized, dynamic water shader in Unreal Engine 5 using just the built-in Material Editor — no plugins, no Niagara (yet), just good ol’ math and nodes.
Shader Goals
We were aiming for:
- Stylized cel-shaded water with soft foam edges
- World-space movement for wave flow
- Adjustable depth-based color blend
- Low-cost for performance on mobile and mid-range PCs
Key Techniques Used
- World Position Offset with sine waves for surface movement
- Scene Depth to detect shorelines and blend foam
- Custom Depth/Fresnel for outlining objects intersecting the water
- Color Ramp Texture for stylized water color transitions
Here’s a quick look:
(You can drop a GIF or image here if posting on the forum)
Performance Notes
The entire shader costs about 140 instructions, which runs smoothly even on our test Android device (Snapdragon 855). If you’re building for mobile, disable high-end features like translucency reflections.
Tips for Other Devs
- Use Time * X for directional wave flow
- Layer 2–3 sine waves with different speeds for more organic movement
- Avoid translucent materials for water unless absolutely necessary
Got Questions? Want the Graph?
We’re happy to share the full material graph screenshot if anyone’s interested. Let us know below, or drop your own tips on stylized water — we’re always learning too!