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.
- 🌊 Gerstner Waves for natural ocean motion
- 💡 Caustics projection
- 🫧 Foam effects
- 🎨 Depth-based water coloring (shallow vs. deep)
- ⚙️ Customizable shader parameters for fine control
- Clone or download the repository.
- Open it in Godot 4 (This project was last tested in 4.5).
- Run the main scene (
world.tscn) to explore the short demo. - Apply the shader to a plane mesh in your own project.
- Increase mesh subdivisions for more detailed waves (
⚠️ watch performance on large meshes).
- Increase mesh subdivisions for more detailed waves (
- For large planes (e.g.
500x500), subdivisions above1000may impact performance. - Shader parameters are grouped for easy tweaking inside the inspector.
This project is available under the MIT license.
Feel free to use, modify, and adapt it in your own projects.