tessarakkt/godot4-oceanfft

Tessendorf FFT based ocean waves and buoyancy in Godot 4 using compute shaders

GDScript

607

138 commits

updated Nov 19, 2025

See the code

README

Godot 4 Ocean Addon

[!NOTE] Requires Godot 4.3+

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.

Ocean

Features

  • 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

Example Scene Controls

ButtonAction
`/~Toggle menu/free cam modes
Mouse MotionFree cam look
Right ClickFree cam zoom
WFree cam forwards (locked to horizontal plane)
SFree cam backwards (locked to horizontal plane)
AFree cam strafe left (locked to horizontal plane)
DFree cam strafe right (locked to horizontal plane)
SpaceFree cam up (locked to vertical axis)
CtrlFree cam down (locked to vertical axis)
ShiftFree cam sprint/move faster

Todo List

  • 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.

OceanCDLOD

OceanUnderwater

OceanCurve

References

Wave Generation Theory

Water Implementation Examples

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.

AAA-Game Implementation Examples

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.

Level Of Detail Implementation

Foam/Whitecap Rendering

Wave Collision Interaction

Miscellaneous

game-development
godot
godot4
godot-engine
ocean
ocean-modelling

tessarakkt/godot4-oceanfft

Tessendorf FFT based ocean waves and buoyancy in Godot 4 using compute shaders

GDScript

607

138 commits

updated Nov 19, 2025

See the code

README

Godot 4 Ocean Addon

[!NOTE] Requires Godot 4.3+

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.

Ocean

Features

  • 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

Example Scene Controls

ButtonAction
`/~Toggle menu/free cam modes
Mouse MotionFree cam look
Right ClickFree cam zoom
WFree cam forwards (locked to horizontal plane)
SFree cam backwards (locked to horizontal plane)
AFree cam strafe left (locked to horizontal plane)
DFree cam strafe right (locked to horizontal plane)
SpaceFree cam up (locked to vertical axis)
CtrlFree cam down (locked to vertical axis)
ShiftFree cam sprint/move faster

Todo List

  • 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.

OceanCDLOD

OceanUnderwater

OceanCurve

References

Wave Generation Theory

Water Implementation Examples

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.

AAA-Game Implementation Examples

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.

Level Of Detail Implementation

Foam/Whitecap Rendering

Wave Collision Interaction

Miscellaneous

game-development
godot
godot4
godot-engine
ocean
ocean-modelling

Significant stargazers

Rémi Verschelde

1,792 followers · starred Feb 2023

Wilson Enrique Alvarez Torres

51 followers · starred Feb 2025

Will Nations

154 followers · starred Jan 2025

Feliks Weber

46 followers · starred Jan 2023