{
 "id": "fft-ocean",
 "title": "FFT Ocean (Tessendorf)",
 "aliases": [
  "Tessendorf ocean",
  "statistical ocean waves",
  "inverse FFT ocean"
 ],
 "domain": "volumes",
 "subdomain": "ocean",
 "stage": "volume",
 "realtime": "realtime",
 "platforms": [
  "webgl2",
  "webgpu",
  "desktop-gpu",
  "cuda",
  "unity",
  "unreal",
  "houdini",
  "blender"
 ],
 "year_introduced": 2001,
 "inputs": [
  "material-params"
 ],
 "outputs": [
  "heightfield",
  "normals",
  "texture"
 ],
 "style": "photoreal",
 "dynamic": "dynamic",
 "summary": "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.",
 "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_use": "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.\n\nPrefer `gerstner-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` for interactive ripples and wakes near shores. Use `jonswap-spectrum` as the input spectrum for fully developed seas.",
 "cost": {
  "class": "medium",
  "notes": "Several N by N inverse FFTs per frame per cascade (N = 256 to 512 is common); cost is dominated by FFT compute passes."
 },
 "failure_modes": [
  "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"
 ],
 "sources": [
  {
   "role": "primary",
   "key": "url:https://people.computing.clemson.edu/~jtessen/reports/papers_files/coursenotes2004.pdf",
   "type": "web",
   "title": "Simulating Ocean Water",
   "authors": [
    "Jerry Tessendorf"
   ],
   "year": null,
   "venue": "SIGGRAPH Course Notes 2001/2004",
   "url": "https://jtessen.people.clemson.edu/reports/papers_files/coursenotes2004.pdf",
   "ids": {},
   "license": null,
   "extra": {
    "http_status": 200,
    "live": true,
    "archive": {
     "url": "http://web.archive.org/web/20261021155515/https://jtessen.people.clemson.edu/reports/papers_files/coursenotes2004.pdf",
     "timestamp": "20261021155515"
    },
    "page_title": null,
    "host": "jtessen.people.clemson.edu",
    "title_confirmed_by_page": false,
    "title_unconfirmed": false
   },
   "provenance": {
    "title": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "http",
     "endpoint": "GET https://people.computing.clemson.edu/~jtessen/reports/papers_files/coursenotes2004.pdf → 200",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "research-draft",
     "endpoint": "title_hint/author_hint, checked against page title where available",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "tessendorfsimulating"
  },
  {
   "role": "primary",
   "key": "doi:10.1145/2791261.2791267",
   "type": "paper",
   "title": "Empirical directional wave spectra for computer graphics",
   "authors": [
    "Christopher J. Horvath"
   ],
   "year": 2015,
   "venue": "Proceedings of the 2015 Symposium on Digital Production",
   "url": "https://doi.org/10.1145/2791261.2791267",
   "ids": {
    "doi": "10.1145/2791261.2791267"
   },
   "license": null,
   "extra": {
    "csl_type": "proceedings-article"
   },
   "provenance": {
    "title": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2791261.2791267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2791261.2791267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2791261.2791267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2791261.2791267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "crossref",
     "endpoint": "https://api.crossref.org/works/10.1145/2791261.2791267",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": 1,
   "__bib": "horvath2015empirical"
  },
  {
   "role": "implementation",
   "key": "gh:gasgiant/fft-ocean",
   "type": "code",
   "title": "gasgiant/FFT-Ocean",
   "description": "FFT ocean for Unity",
   "authors": [
    "gasgiant"
   ],
   "year": 2020,
   "venue": "GitHub",
   "url": "https://github.com/gasgiant/FFT-Ocean",
   "ids": {
    "repo": "gasgiant/FFT-Ocean"
   },
   "license": "MIT",
   "extra": {
    "stars": 813,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2022-07-07T16:30:00Z",
    "language": "C#",
    "homepage": null,
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gasgiant/FFT-Ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gasgiant/FFT-Ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gasgiant/FFT-Ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gasgiant/FFT-Ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gasgiant/FFT-Ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/gasgiant/FFT-Ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "gasgiant2020gasgiant"
  },
  {
   "role": "implementation",
   "key": "gh:jbouny/ocean",
   "type": "code",
   "title": "jbouny/ocean",
   "description": "Realistic water shader for Three.js",
   "authors": [
    "jbouny"
   ],
   "year": 2013,
   "venue": "GitHub",
   "url": "https://github.com/jbouny/ocean",
   "ids": {
    "repo": "jbouny/ocean"
   },
   "license": "MIT",
   "extra": {
    "stars": 808,
    "stars_checked": "2026-11-29",
    "archived": false,
    "fork": false,
    "pushed_at": "2017-10-18T20:25:15Z",
    "language": "JavaScript",
    "homepage": "http://jeremybouny.fr/ocean/demo/",
    "license_name": "MIT License"
   },
   "provenance": {
    "title": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/jbouny/ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "authors": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/jbouny/ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "year": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/jbouny/ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "venue": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/jbouny/ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "url": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/jbouny/ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    },
    "license": {
     "authority": "github",
     "endpoint": "https://api.github.com/repos/jbouny/ocean",
     "checked_at": "2026-11-29T15:51:27.588Z"
    }
   },
   "status": "verified",
   "checked_at": "2026-11-29T15:51:27.588Z",
   "title_sim": null,
   "__bib": "jbouny2013jbouny"
  }
 ],
 "presets": [
  {
   "id": "fft-ocean-live",
   "title": "Tessendorf spectral ocean — Phillips dispersion wave sum with choppy crests and foam",
   "runtime": "glsl-fragment",
   "params": {
    "WIND_SPEED": 1.35,
    "CHOPPINESS": 1.15,
    "FOAM_BIAS": 0.58,
    "WATER_CLARITY": 0.65
   },
   "basis": "original",
   "license_note": "MIT — written for this index",
   "code": "const float WIND_SPEED = 1.35; // P\nconst float CHOPPINESS = 1.15; // P\nconst float FOAM_BIAS = 0.58; // P\nconst float WATER_CLARITY = 0.65; // P\n\n// Multi-band Phillips-spectrum directional wave synthesis with deep-water dispersion\nvec3 evalWave(vec2 p, float t, float wind, float chop, out float jacobian) {\n  vec2 windDir = normalize(vec2(0.82, 0.57));\n  float L = max(wind * wind * 0.45, 0.08);\n  float h = 0.0;\n  vec2 slope = vec2(0.0);\n  float fold = 0.0;\n  float freq = 0.42;\n  for (int i = 0; i < 14; i++) {\n    float fi = float(i);\n    float ang = fi * 2.39996 + 0.35 * sin(fi * 1.7);\n    vec2 kDir = vec2(cos(ang), sin(ang));\n    float align = abs(dot(kDir, windDir));\n    float k = freq;\n    float kL = max(k * L, 0.25);\n    float phillips = exp(-1.0 / (kL * kL)) / (k * k * k) * (0.28 + 0.72 * align * align);\n    float amp = sqrt(phillips) * 0.14 * max(wind, 0.2);\n    float omega = sqrt(9.81 * k);\n    float ph = dot(kDir * k, p) - omega * t + fi * 1.91;\n    float s = sin(ph), c = cos(ph);\n    h += amp * s;\n    slope += kDir * (amp * k * c);\n    fold += chop * amp * k * s;\n    freq *= 1.24;\n  }\n  jacobian = 1.0 - fold;\n  return vec3(slope.x, h, slope.y);\n}\n\nvec3 skyColor(vec3 d, vec3 sunDir) {\n  float y = max(d.y, 0.0);\n  vec3 zenith = vec3(0.11, 0.26, 0.52);\n  vec3 horiz = vec3(0.82, 0.64, 0.48);\n  vec3 col = mix(horiz, zenith, pow(y, 0.52));\n  float sun = max(dot(d, sunDir), 0.0);\n  col += vec3(1.0, 0.72, 0.42) * pow(sun, 12.0) * 0.65;\n  col += vec3(1.0, 0.92, 0.78) * pow(sun, 220.0) * 4.5;\n  return col;\n}\n\nvec3 aces(vec3 x) {\n  x = max(x, 0.0);\n  return (x * (2.51 * x + 0.03)) / (x * (2.43 * x + 0.59) + 0.14);\n}\n\nvoid mainImage(out vec4 fragColor, in vec2 fragCoord) {\n  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;\n  float yaw = 0.0;\n  if (iMouse.z > 0.5 || length(iMouse.xy) > 1.0) yaw = (iMouse.x / iResolution.x - 0.5) * 1.4;\n  vec3 ro = vec3(0.0, 2.35, 0.0);\n  vec3 rd = normalize(vec3(uv.x, uv.y - 0.16, -1.25));\n  float cy = cos(yaw), sy = sin(yaw);\n  rd.xz = mat2(cy, -sy, sy, cy) * rd.xz;\n\n  vec3 sunDir = normalize(vec3(0.38, 0.24, -0.89));\n  float wind = max(WIND_SPEED, 0.15);\n  float chop = max(CHOPPINESS, 0.0);\n\n  if (rd.y > 0.02) {\n    vec3 col = skyColor(rd, sunDir);\n    fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n    return;\n  }\n\n  float t = 0.6, tMax = 65.0;\n  float prevD = 1.0, prevT = t;\n  bool hit = false;\n  float jac = 1.0;\n  vec3 wv = vec3(0.0);\n  for (int i = 0; i < 48; i++) {\n    vec3 p = ro + rd * t;\n    wv = evalWave(p.xz, iTime, wind, chop, jac);\n    float d = p.y - wv.y;\n    if (d < 0.0) {\n      float a = prevT, b = t;\n      for (int k = 0; k < 4; k++) {\n        float m = 0.5 * (a + b);\n        vec3 pm = ro + rd * m;\n        wv = evalWave(pm.xz, iTime, wind, chop, jac);\n        if (pm.y - wv.y < 0.0) b = m; else a = m;\n      }\n      t = 0.5 * (a + b);\n      hit = true;\n      break;\n    }\n    prevD = d; prevT = t;\n    t += max(0.18, d * 0.55 + t * 0.045);\n    if (t > tMax) break;\n  }\n\n  vec3 col = skyColor(rd, sunDir);\n  if (hit) {\n    vec3 p = ro + rd * t;\n    wv = evalWave(p.xz, iTime, wind, chop, jac);\n    vec3 n = normalize(vec3(-wv.x, 1.0, -wv.z));\n    float ndv = max(dot(n, -rd), 0.001);\n    float fres = 0.02 + 0.98 * pow(1.0 - ndv, 5.0);\n    vec3 refl = reflect(rd, n);\n    refl.y = max(refl.y, 0.01);\n    vec3 env = skyColor(normalize(refl), sunDir);\n\n    // Subsurface scatter through sunlit wave crests\n    float sss = pow(max(dot(rd, sunDir), 0.0), 3.0) * smoothstep(-0.2, 0.65, wv.y) * max(WATER_CLARITY, 0.0);\n    vec3 deepCol = vec3(0.012, 0.065, 0.11);\n    vec3 scatterCol = vec3(0.04, 0.38, 0.36) * (0.28 + 1.35 * sss);\n    vec3 water = mix(deepCol + scatterCol, env, fres);\n\n    // Crisp sun specular sparkle\n    vec3 h = normalize(sunDir - rd);\n    float spec = pow(max(dot(n, h), 0.0), 180.0) * 3.8;\n    water += vec3(1.0, 0.88, 0.68) * spec;\n\n    // Jacobian crest folding -> whitecap foam\n    float foamMask = smoothstep(FOAM_BIAS, FOAM_BIAS - 0.38, jac) * smoothstep(-0.05, 0.38, wv.y);\n    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);\n    float foam = clamp(foamMask * (0.55 + 0.65 * fTex), 0.0, 1.0);\n    water = mix(water, vec3(0.88, 0.92, 0.95) * (0.55 + 0.45 * max(dot(n, sunDir), 0.0)), foam * 0.88);\n\n    float fog = 1.0 - exp(-0.018 * t);\n    col = mix(water, skyColor(normalize(vec3(rd.x, 0.015, rd.z)), sunDir), fog);\n  }\n  fragColor = vec4(pow(clamp(aces(col), 0.0, 1.0), vec3(1.0 / 2.2)), 1.0);\n}",
   "execution_fidelity": "reduced-sandbox",
   "proof": {
    "kind": "rendered",
    "label": "rendered 2026-11-30",
    "ok": true,
    "proof": {
     "ok": true,
     "technique": "fft-ocean",
     "runtime": "glsl-fragment",
     "checked_at": "2026-11-30T16:15:34.232Z",
     "renderer": "Chromium 145.0.7632.6 headless, WebGL2 via ANGLE/SwiftShader, 512×512, iTime=1.5",
     "stats": {
      "mean": 0.7763,
      "std": 0.1089,
      "unique_colors": 95
     },
     "image": "/specimens/fft-ocean-live.webp",
     "reason": null
    }
   }
  }
 ],
 "related": [
  "jonswap-spectrum",
  "gerstner-waves",
  "shallow-water-equations",
  "water-caustics-realtime"
 ],
 "extends": [
  "jonswap-spectrum"
 ],
 "supersedes": [],
 "combines_with": [
  {
   "id": "jonswap-spectrum",
   "why": "Provides the directional amplitude spectrum that scales the random amplitudes before the FFT."
  },
  {
   "id": "water-caustics-realtime",
   "why": "Slope and height maps from the FFT drive the refraction that creates caustic patterns on the seabed."
  }
 ],
 "provenance": {
  "prose": "original text written for this index (research draft, editorially reviewed)",
  "sources_verified_at": "2026-11-29T15:51:27.588Z",
  "draft": "data/drafts/volumes/fft-ocean.json"
 },
 "solves": [
  "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"
 ],
 "authority": "Tessendorf",
 "url": "https://texelatlas.vercel.app/t/fft-ocean/",
 "execution_fidelity": "reduced-sandbox",
 "fidelity_label": "Analytic Sandbox",
 "benchmark_eligible": true,
 "gpu_weight": {
  "weight_x": 35.28,
  "tier": "heavy",
  "p50_ms": 1.1608,
  "p95_ms": 1.215,
  "baseline_p50_ms": 0.0329,
  "gpu": "Tesla T4/PCIe/SSE2",
  "resolution": "1920x1080",
  "method": "opengl-timer-query",
  "frames": 40,
  "preset_id": "fft-ocean-live",
  "execution_fidelity": "reduced-sandbox",
  "fidelity_label": "Analytic Sandbox",
  "benchmark_eligible": true,
  "generated_at": "2026-11-30T21:07:47Z",
  "l4": {
   "weight_x": 27.32,
   "tier": "heavy",
   "p50_ms": 0.4344,
   "p95_ms": 0.4394,
   "speedup_x": 2.67,
   "gpu": "NVIDIA L4/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0159
  },
  "a100": {
   "weight_x": 21.51,
   "tier": "heavy",
   "p50_ms": 0.6194,
   "p95_ms": 0.6225,
   "speedup_x": 1.87,
   "gpu": "NVIDIA A100-SXM4-40GB/PCIe/SSE2",
   "resolution": "1920x1080",
   "baseline_p50_ms": 0.0288
  }
 }
}