Water Shader
At first I made this water shader for my own personal use, but then realised that other people might be interseted in something like this, so here it is!
Some effects may take longer to render, for example if you are using dispersion and caustics then rendertimes may take longer. There are also some effects that require ample amounts of geometry to work properly.
What you will receive:
- Water shader with animated waves, caustics, dispersion, and foam.
- Rain effects. This is a nodegroup which outputs a ripple mask. You can use this as a displacement.
- Fake flow map effect. This is a flow map effect made by using geometry proximity.
- Water level. A quick and dirty way to add a universal sediment layer to your materials that is globally controlled.
- Geometry node setup to distribute leaves along the shoreline, rain particles, and bubbles.
What is marked as an asset: The water material, water shader nodegroup, rain ripples nodegroup, flow map node group, water object.
If you use the water object as an asset then it will import everything for the water with the asset.
The water shader:
The caustics:
The caustics are faked using a combination of voronoi textures. The caustics can be animated as well.
Dispersion:
Volumetrics:
To get a realistic water effect it is important to get a nice looking volume. For this reason you can choose two colors that are mixed for the volume, as well as control over the volume density based on the water depth.
Foam:
No water is complete without surface details. For the surface details one of the layers is froth/foam:
This setup uses noise patterns and ambient occlusion. There are two layers to the foam patterns one of them is a general foam on the water surface, and the other one is Ambient occlusin based contact foam that appears near objects that are in contact with the water.
Waves:
The node groups contains some procedural waves that can be animated:
Flow Map:
Waves based on geometry proximity. This effect uses geometry nodes and attributes and results in a effect that looks as if the water is influenced by the shoreline objects. For this to work you need to have ample amounts of geometry to ensure good wave resolution. You also need to put every shoreline object into one collection.
Rain:
A rain spash effect.
Geometry node group:
As mentioned above you can have a wave effect based on geometry proximity. For this you can select the resolution and the group that will be affecting the water.
Scatter leaves and other objects close to shoreline:
You have the option to scatter leaves and other objects near the shoreline. This uses geometry proximity, so the resolution of the scattering mask depends on the subdivision resolution.
This effect is relatively slow, so it is best left turned off until you have finalized the position of the shoreline.
Raindrops
Also included is a raindrop generator that spawns a raindrop object onto the surface of the water.
I reccomend using transparent raindrop cards to retain performance. I have provided a raindrop card in the blend file.
The raindrop objects and the raindrop effects on the shader do not line up. This means that this effect is probably not good for extreme close up shots.
I have aslo included a geo node group that spawns raindrops onto any object that is in a selected collection.
Bubbles:
This allows bubbles to be distributed inside the volume of the water.
The simple water shader variant
In the simple water shader variant that you can get for 0.51 dollars, you get a simplified version of the water shader. This still has caustics, contact foam, and animated simplified waves, but does not contain the rain map, the flow map, and the geometry node setups.
Overall the simple water shader looks very similar to the complex shader.
If you want the simplified water shader for FREE, you can get it on my gumroad: https://mart0nnn.gumroad.com/l/simplewater
(this is because blendermarket doesn't allow free products for non-subscribers)
Last but not least...
Here are some resources that I found extremely useful when creating this project:
CG matter's video on how to create procedural raindrops: https://youtu.be/1eKkbgOaykw
CG vertex's video on continuous dispersion: https://youtu.be/lEPZ1IUkoB4
Discover more products like this
ultimate water shader Water caustics freshwater Dynamic water ripples spring24 animated-water rain