Skip to content

Godot Water Shader 🌊 A Godot 4 demo project featuring a Gerstner wave ocean shader with caustics, foam, and depth-based colouring.

License

Notifications You must be signed in to change notification settings

LesusX/Water-Shader

Repository files navigation

Screenshot 2025-02-15 190426

Godot Water Shader Demo 🌊

This project showcases a Gerstner wave ocean shader built in Godot 4.
The shader simulates realistic ocean movement, caustics, foam, and depth-based color blending.

The repository includes:

  • A main demo scene with islands, props, and a player.
  • A customizable shader with grouped uniforms for waves, depth, foam, and surface details.
  • Support for caustics, edge foam, peak highlights, and noise-based surface variation.

Features

  • 🌊 Gerstner Waves for natural ocean motion
  • 💡 Caustics projection
  • 🫧 Foam effects
  • 🎨 Depth-based water coloring (shallow vs. deep)
  • ⚙️ Customizable shader parameters for fine control

How to Use

  1. Clone or download the repository.
  2. Open it in Godot 4 (This project was last tested in 4.5).
  3. Run the main scene (world.tscn) to explore the short demo.
  4. Apply the shader to a plane mesh in your own project.
    • Increase mesh subdivisions for more detailed waves (⚠️ watch performance on large meshes).

Notes

  • For large planes (e.g. 500x500), subdivisions above 1000 may impact performance.
  • Shader parameters are grouped for easy tweaking inside the inspector.

License

This project is available under the MIT license.
Feel free to use, modify, and adapt it in your own projects.


About

Godot Water Shader 🌊 A Godot 4 demo project featuring a Gerstner wave ocean shader with caustics, foam, and depth-based colouring.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published