Real-time ocean surface simulation running entirely on the GPU, using the Inverse Fast Fourier Transform (IFFT) with the JONSWAP spectrum for wave energy distribution — the same approach used in AAA game engines like those behind Sea of Thieves and Assassin's Creed: Black Flag.
The simulation generates a statistically realistic ocean surface by:
- Building a frequency-domain spectrum using the JONSWAP model based on wind speed, fetch length, and sea state
- Evolving it over time using wave dispersion relations
- Running an IFFT on the GPU via cuFFT to recover the spatial surface each frame
- Rendering the result in real-time using OpenGL with CUDA/GL interop
An ImGui debug panel allows live tuning of wind parameters, wave amplitude, and choppiness without restarting.
- CUDA + cuFFT — GPU compute and FFT
- OpenGL + GLEW — real-time rendering
- GLFW — windowing
- GLM — math
- ImGui + ImPlot — debug UI
- CUDA Toolkit (tested on CUDA 12.x)
- GLFW 3
- GLEW
- OpenGL
External dependencies (imgui, glfw, glm) are in external/.
# Build the project
makemake run
# or directly:
./output/fft_program- Hasselmann et al., Measurements of Wind-Wave Growth and Swell Decay during the Joint North Sea Wave Project (JONSWAP), 1973
- J. Tessendorf, Simulating Ocean Water, SIGGRAPH 2001 Course Notes
- FFT-Ocean by gasgiant
- Water by GarrettGunnell
- Video reference 1
- Video reference 2