UnityEngineWater Shader2022-07

With Shader Graph in Unity URP
Shader GraphURPVFXUnity
View on GitHub

Water shader with dynamic configurations, which can simulate several environmental effects.

Implementation

  • Water depth effect using Scene Depth node (Camera Depth Buffer) and Screen Position node (Fragment Position)
  • Refractions using Screen Color node to render distorted objects behind the water, using Normals generated from height from a gradient noise.
  • Foam generated using the Scene Depth node and a gradient noise.
  • Waves achieved with geometry displacement, adding Normals multiplied by a gradient noise, effectively deforming the fragment geometry.