FFT Ocean (Tessendorf)
Synthesise a tileable, animated ocean surface by evolving a random wave spectrum in the frequency domain and taking an inverse FFT each frame for height, choppy displacement and slopes.
Also known as Tessendorf ocean, statistical ocean waves, inverse FFT ocean
In the family Atmosphere, water & volumes, ocean
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | None found | |
| Babylon.js 9.38.0 | None found | |
| Godot 4.7 | None found | |
| Unity | Built in | GameObject > Water > Ocean, Sea or Lake (HDRP Water System) docs HDRP only; FFT-based spectrum simulation (Phillips). |
| Unreal 5.7 | Official add-on | Water plugin (WaterBodyOcean wave spectrum & Gerstner/FFT ocean system) docs |
| Blender 5.2 | Built in | Add Modifier > Physics > Ocean docs Port of the Houdini Ocean Toolkit (spectral FFT ocean). |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
Draw a random complex amplitude for every wave vector k on an N by N grid, scaled by the square root of a directional wave spectrum (Phillips, or JONSWAP with a spreading function). Each frame, advance the phase of each amplitude by the deep-water dispersion relation, omega = sqrt(g |k|), keeping the conjugate-symmetric partner so the result is real. Inverse FFTs then produce the height field, the horizontal displacement (multiplying by i k / |k| for choppiness), and the x and z slopes (multiplying by i k). The displaced grid is rendered as a heightfield mesh or vertex-texture-fetch plane, with the slopes giving normals, and a Jacobian of the displacement indicating where waves fold and foam appears. Multiple cascades with different tile sizes are blended to avoid visible tiling at near and far distances.
When to choose it
Reach for it when
- ocean should look like real wind-driven waves
- need tileable animated sea surface for open water
- waves need choppy crests and realistic spectrum
- water repeats too obviously with a few sine waves
- control wave look by wind speed and direction
Choose it for open-sea scenes with realistic wind-driven wave statistics, where the surface must tile, animate indefinitely and respond to wind speed and direction in real time.
Prefer Gerstner (Trochoidal) Waves when you need a few controllable, analytic waves for stylised water or cheap mobile hardware, and when gameplay needs the exact surface height in a gameplay script. Prefer Shallow Water Equations (Height-field Water) for interactive ripples and wakes near shores. Use JONSWAP Wave Spectrum as the input spectrum for fully developed seas.
Field marks
- Visible repetition of the tile at distance when only one cascade is used
- Aliasing or shimmering of high-frequency normals at distance without normal mip filtering or roughness adjustment
- Choppy displacement self-intersections (loops) if the choppiness scale is too large
- Waves cannot interact with boats, shores or obstacles because the model is purely statistical
- Aliasing in the spectrum when the grid size and tile length make high k exceed Nyquist for the chosen wavelengths
Presets
Tessendorf spectral ocean — Phillips dispersion wave sum with choppy crests and foam
{
"WIND_SPEED": 1.35,
"CHOPPINESS": 1.15,
"FOAM_BIAS": 0.58,
"WATER_CLARITY": 0.65
}Show GLSL (128 lines)
const float WIND_SPEED = 1.35; // P
const float CHOPPINESS = 1.15; // P
const float FOAM_BIAS = 0.58; // P
const float WATER_CLARITY = 0.65; // P
// Multi-band Phillips-spectrum directional wave synthesis with deep-water dispersion
vec3 evalWave(vec2 p, float t, float wind, float chop, out float jacobian) {
vec2 windDir = normalize(vec2(0.82, 0.57));
float L = max(wind * wind * 0.45, 0.08);
float h = 0.0;
vec2 slope = vec2(0.0);
float fold = 0.0;
float freq = 0.42;
for (int i = 0; i < 14; i++) {
float fi = float(i);
float ang = fi * 2.39996 + 0.35 * sin(fi * 1.7);
vec2 kDir = vec2(cos(ang), sin(ang));
float align = abs(dot(kDir, windDir));
float k = freq;
float kL = max(k * L, 0.25);
float phillips = exp(-1.0 / (kL * kL)) / (k * k * k) * (0.28 + 0.72 * align * align);
float amp = sqrt(phillips) * 0.14 * max(wind, 0.2);
float omega = sqrt(9.81 * k);
float ph = dot(kDir * k, p) - omega * t + fi * 1.91;
float s = sin(ph), c = cos(ph);
h += amp * s;
slope += kDir * (amp * k * c);
fold += chop * amp * k * s;
freq *= 1.24;
}
jacobian = 1.0 - fold;
return vec3(slope.x, h, slope.y);
}
vec3 skyColor(vec3 d, vec3 sunDir) {
float y = max(d.y, 0.0);
vec3 zenith = vec3(0.11, 0.26, 0.52);
vec3 horiz = vec3(0.82, 0.64, 0.48);
vec3 col = mix(horiz, zenith, pow(y, 0.52));
float sun = max(dot(d, sunDir), 0.0);
col += vec3(1.0, 0.72, 0.42) * pow(sun, 12.0) * 0.65;
col += vec3(1.0, 0.92, 0.78) * pow(sun, 220.0) * 4.5;
return col;
}
vec3 aces(vec3 x) {
x = max(x, 0.0);
return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
float yaw = 0.0;
if (iMouse.z > 0.5 || length(iMouse.xy) > 1.0) yaw = (iMouse.x / iResolution.x - 0.5) * 1.4;
vec3 ro = vec3(0.0, 2.35, 0.0);
vec3 rd = normalize(vec3(uv.x, uv.y - 0.16, -1.25));
float cy = cos(yaw), sy = sin(yaw);
rd.xz = mat2(cy, -sy, sy, cy) * rd.xz;
vec3 sunDir = normalize(vec3(0.38, 0.24, -0.89));
float wind = max(WIND_SPEED, 0.15);
float chop = max(CHOPPINESS, 0.0);
if (rd.y > 0.02) {
vec3 col = skyColor(rd, sunDir);
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
return;
}
float t = 0.6, tMax = 65.0;
float prevD = 1.0, prevT = t;
bool hit = false;
float jac = 1.0;
vec3 wv = vec3(0.0);
for (int i = 0; i < 48; i++) {
vec3 p = ro + rd * t;
wv = evalWave(p.xz, iTime, wind, chop, jac);
float d = p.y - wv.y;
if (d < 0.0) {
float a = prevT, b = t;
for (int k = 0; k < 4; k++) {
float m = 0.5 * (a + b);
vec3 pm = ro + rd * m;
wv = evalWave(pm.xz, iTime, wind, chop, jac);
if (pm.y - wv.y < 0.0) b = m; else a = m;
}
t = 0.5 * (a + b);
hit = true;
break;
}
prevD = d; prevT = t;
t += max(0.18, d * 0.55 + t * 0.045);
if (t > tMax) break;
}
vec3 col = skyColor(rd, sunDir);
if (hit) {
vec3 p = ro + rd * t;
wv = evalWave(p.xz, iTime, wind, chop, jac);
vec3 n = normalize(vec3(-wv.x, 1.0, -wv.z));
float ndv = max(dot(n, -rd), 0.001);
float fres = 0.02 + 0.98 * pow(1.0 - ndv, 5.0);
vec3 refl = reflect(rd, n);
refl.y = max(refl.y, 0.01);
vec3 env = skyColor(normalize(refl), sunDir);
// Subsurface scatter through sunlit wave crests
float sss = pow(max(dot(rd, sunDir), 0.0), 3.0) * smoothstep(-0.2, 0.65, wv.y) * max(WATER_CLARITY, 0.0);
vec3 deepCol = vec3(0.012, 0.065, 0.11);
vec3 scatterCol = vec3(0.04, 0.38, 0.36) * (0.28 + 1.35 * sss);
vec3 water = mix(deepCol + scatterCol, env, fres);
// Crisp sun specular sparkle
vec3 h = normalize(sunDir - rd);
float spec = pow(max(dot(n, h), 0.0), 180.0) * 3.8;
water += vec3(1.0, 0.88, 0.68) * spec;
// Jacobian crest folding -> whitecap foam
float foamMask = smoothstep(FOAM_BIAS, FOAM_BIAS - 0.38, jac) * smoothstep(-0.05, 0.38, wv.y);
float fTex = 0.5 + 0.5 * sin(p.x * 9.0 + sin(p.z * 7.0)) * cos(p.z * 8.0 - p.x * 5.0);
float foam = clamp(foamMask * (0.55 + 0.65 * fTex), 0.0, 1.0);
water = mix(water, vec3(0.88, 0.92, 0.95) * (0.55 + 0.45 * max(dot(n, sunDir), 0.0)), foam * 0.88);
float fog = 1.0 - exp(-0.018 * t);
col = mix(water, skyColor(normalize(vec3(rd.x, 0.015, rd.z)), sunDir), fog);
}
fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);
}Attribution: MIT — written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| fft-ocean-live | Tesla T4 1920x1080 | 35.3× baseline (heavy) · 1.16 ms / 1.22 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| fft-ocean-live | NVIDIA L4 1920x1080 | 27.3× baseline (heavy) · 0.434 ms / 0.439 ms · 2.7× faster on L4 | opengl-timer-query · Cross-architecture validation |
| fft-ocean-live | NVIDIA A100-SXM4-40GB 1920x1080 | 21.5× baseline (heavy) · 0.619 ms / 0.623 ms · 1.9× faster on A100 | opengl-timer-query · Cross-architecture validation |
Lineage
Crosses
- Bathymetry-refracted coastal ocean with shore caustics: Deep-water spectral swells that physically bend parallel to curving coastlines, steepen as water shallows, and project crisp dancing caustics onto the submerged sand. Solving the eikonal phase field from seabed depth bridges open-ocean FFT synthesis with realistic nearshore breaking and refraction.
- Sun glitter from horizon to bow: An ocean that sparkles at every distance. Waves too small to see fold into a correctly stretched specular lobe, and the same filtered slope distribution drives discrete glints, so distant water glitters instead of turning into a flat smear.
- JONSWAP Wave Spectrum: Provides the directional amplitude spectrum that scales the random amplitudes before the FFT.
- Real-time Water Caustics: Slope and height maps from the FFT drive the refraction that creates caustic patterns on the seabed.
Sources
- primaryJerry Tessendorf. Simulating Ocean Water. SIGGRAPH Course Notes 2001/2004.Verified via live page · 2026-11-29
- primaryChristopher J. Horvath (2015). Empirical directional wave spectra for computer graphics. Proceedings of the 2015 Symposium on Digital Production.Verified via crossref · 2026-11-29doi:10.1145/2791261.2791267
- implementationgasgiant (2020). gasgiant/FFT-Ocean. FFT ocean for UnityGitHub API · license MIT · 2026-11-29
- implementationjbouny (2013). jbouny/ocean. Realistic water shader for Three.jsGitHub API · license MIT · 2026-11-29