A stylized toon-style water shader for Unity’s Universal Render Pipeline (URP), designed to bring vibrant, animated water surfaces to your scenes.
It combines depth-based color gradients, dynamic wave motion, foam simulation, and surface distortion for a rich toon-water aesthetic.
- 🎨 Depth-based coloring — smooth blend between shallow and deep tones
- 🌊 Animated wave displacement using sine motion
- ☁️ Dynamic foam generation from surface depth and normals
- 🌀 Scrolling noise and distortion for surface detail
- 🧩 Fully adjustable properties for frequency, speed, foam, and distortion
- 🔍 Alpha blended transparent rendering
- Unity 2021.3+ (URP enabled)
- Depth texture support must be enabled
(URP Renderer → General → Depth Texture: ✅)
- Copy the shader file into your project (e.g.
Assets/Shaders/ToonWater.shader) - Create a new Material and assign the shader:
Shader → Test → Toon Water - Apply the material to a plane or water mesh
| Property | Description |
|---|---|
| _DepthGradientShallow / Deep | Colors for shallow and deep water |
| _DepthMaxDistance | Distance at which deep color fully appears |
| _FoamColor | Color of surface foam |
| _FoamMaxDistance / MinDistance | Controls foam visibility near edges |
| _SurfaceNoise / Distortion | Textures for surface detail |
| _SurfaceNoiseCutoff | Foam threshold |
| _SurfaceNoiseScroll | UV scroll speed for surface noise |
| _WavesMaxHight | Maximum height of wave displacement |
| _WaveFrequency | Frequency of the waves |
| _WaveSpeed | Speed of wave motion |
| _WaveDirection | X/Z direction of wave flow |
- Use soft gradient colors for natural transitions.
- Adjust _WaveSpeed and _WavesMaxHight for calmer or rougher water.
- Try different noise textures for unique foam shapes.
- Works best with planar meshes and moderate tesselation.
