An early work in progress ocean addon for Godot 4 base on Jerry Tessendorf's FFT method for generating the waves, using compute shaders to generate the displacement map, and a quad tree based continuous distant dependant level of detail (CDLOD) system to dynamically manage the polygon density without popping or snapping between LOD levels.
The GLSL shaders that generates the displacement map were ported into Godot 4 from this project. The underlying math is identical, but some things like binding points and how uniforms were accessed had to be changed to work in Godots compute shader API.
- FFT ocean wave simulation, wave energy derived from Unified Spectrum
- Integrated LOD for surface (CDLOD)
- Basic buoyancy system
- Basic underwater effect
- Basic whitecap rendering
- Surface shading:
- Transparency
- Reflections (provided by ReflectionProbe)
- Refractions
- Sub surface scattering
Button | Action |
---|---|
`/~ | Toggle menu/free cam modes |
Mouse Motion | Free cam look |
Right Click | Free cam zoom |
W | Free cam forwards (locked to horizontal plane) |
S | Free cam backwards (locked to horizontal plane) |
A | Free cam strafe left (locked to horizontal plane) |
D | Free cam strafe right (locked to horizontal plane) |
Space | Free cam up (locked to vertical axis) |
Ctrl | Free cam down (locked to vertical axis) |
Shift | Free cam sprint/move faster |
- Improve visual rendering
- Splash particles
- Improve refractions
- Improve underwater effect
- Lower detail but faster visual shader for lower LOD quads
- Optimize Quadtree3D at large depths
- Beach/cliff/rocks interactions
- Wave collision interactions (boat wakes, splashes, etc.)
- Multiplayer synchronization? This reference may be helpful for this.
- Jerry Tessendorf - Simulating Ocean Water
- Fynn-Jorin Flügge - Realtime GPGPU FFT Ocean Water Simulation
- Thomas Gamper - Ocean Surface Generation and Rendering
- T. Elfouhaily, B. Chapron, K. Katsaros, D. Vandemark - A unified directional spectrum for long and short wind-driven waves
These are not exclusively limited to ocean wave implementations, and may include other types of water simulations if they include visual rendering techniques that are of value to reference.
- The implementation behind the wave height generation: achalpandeyy/OceanFFT
- Platinguin/Godot-Water-Shader-Prototype
- godot-extended-libraries/hydro
- godot-extended-libraries/godot-realistic-water
- Crest
- Virtual Terrain Project
- jdupuy/whitecaps
- AlphaMistral/Mistral-Water
These generally don't give much in the way of code examples, but do give a higher level overview of how the whole thing comes together.
- Assassin’s Creed III: The tech behind (or beneath) the action
- The technical art of Sea of Thieves
- Ocean simulation and rendering in War Thunder
- Wakes, Explosions And Lighting: Interactive Water Simulation in 'Atlas'
- Filip Struger - Continuous Distance-Dependent Level of Detail for Rendering Heightmaps (CDLOD)
- Claes Johanson - Real-time water rendering Introducing the projected grid concept
- Willem H. de Boer - Fast Terrain Rendering Using Geometrical MipMapping
- Frank Losasso, Hugues Hoppe - Geometry Clipmaps: Terrain Rendering Using Nested Regular Grids
- ARM Software - Using the Jacobian for modelling turbulent effects at wave crests
- Mary Yingst, Jennifer R. Alford, Ian Parberry - Very Fast Real-Time Ocean Wave Foam Rendering Using Halftoning
- Lining Chen, Yicheng Jin, Yong Yin - Ocean Wave Rendering with Whitecap in the Visual System of a Maritime Simulator
- Jonathan Dupuy, Eric Bruneton - Real-time Animation and Rendering of Ocean Whitecaps
- Jerry Tessendorf - eWave: Using an Exponential Solver on the iWave Problem
- Jerry Tessendorf - Simulation of Interactive Surface Waves
- Stefan Jeschke, Tomáš Skřivan, Matthias Müller-fischer, Nuttapong Chentanez, Miles Macklin, Chris Wojtan - Water Surface Wavelets
- Jos Stam - A Simple Fluid Solver based on the FFT
- Khan Academy - Computing a Jacobian matrix
- Jump Trajectory - Ocean waves simulation with Fast Fourier transform
- Tiago Sousa - GPU Gems 2: Chapter 19. Generic Refraction Simulation
- Kenny Mitchell - GPU Gems 3: Chapter 13. Volumetric Light Scattering as a Post-Process
- Matt Pharr, Wenzel Jakob, Greg Humphreys - Physically Based Rendering: From Theory To Implementation: 8.4 Microfacet Models
- Eric Bruneton, Fabrice Neyret, Nicolas Holzschuch - Real-time Realistic Ocean Lighting using Seamless Transitions from Geometry to BRDF