---
id: "jonswap-spectrum"
title: "JONSWAP Wave Spectrum"
aliases: [JONSWAP, Joint North Sea Wave Project spectrum]
domain: "volumes"
stage: "volume"
realtime: "realtime"
platforms: [webgl2, webgpu, desktop-gpu, cuda, unity, unreal, houdini, blender]
year_introduced: 1973
inputs: [material-params]
outputs: [texture]
style: "photoreal"
dynamic: "dynamic"
cost: "cheap"
authority: "Horvath, 2015"
url: "https://texelatlas.vercel.app/t/jonswap-spectrum/"
sources_verified_at: "2026-11-29"
---
# JONSWAP Wave Spectrum (Horvath, 2015)

> An empirical wave energy spectrum for wind seas that are still growing, with a sharp peak at the dominant frequency, used to seed the amplitudes of an FFT ocean.

## Reach for it when

- ocean waves look unrealistic or too regular
- need sea state driven by wind speed and fetch
- fft ocean wave heights need a believable spectrum
- wave patterns for open sea versus calm lake

## How it works

The JONSWAP spectrum is the Pierson-Moskowitz fully developed sea spectrum multiplied by a peak enhancement factor gamma raised to an exponent that depends on how close the frequency is to the peak. Its inputs are wind speed, fetch (the distance of open water the wind has blown over) and optionally peak frequency; from these you derive the peak frequency and the Phillips-like alpha constant. The result gives energy per frequency. For graphics you convert it into a function of the wave vector, multiply by a directional spreading function such as cosine to a power around the wind direction (frequency-dependent in more accurate versions), and divide by the Jacobian of the dispersion relation to get energy per unit area in k-space. The square root of that is the standard deviation used to draw each random Fourier amplitude. A short-wave cutoff and a damping factor for waves moving against the wind are usually added.

## When to use it

Choose it when an FFT ocean must respond to physically meaningful inputs (wind speed, fetch) and show a narrow dominant swell rather than the broad, scale-free look of the Phillips spectrum.

Prefer the Phillips spectrum for the simplest, widely documented setup in [FFT Ocean (Tessendorf)](https://texelatlas.vercel.app/t/fft-ocean.md). Prefer hand-picked amplitudes in [Gerstner (Trochoidal) Waves](https://texelatlas.vercel.app/t/gerstner-waves.md) if you just need a few art-directed swells.

## Cost

cheap — Evaluated once per grid cell when (re)generating the initial spectrum texture, not every frame.
Measured GPU Weight: 75.42× baseline (extreme) — 2.4812 ms median / 2.5715 ms p95 on Tesla T4/PCIe/SSE2 @ 1920x1080 (opengl-timer-query).
Ada L4 scaling: 56.77× baseline (heavy) — 0.9027 ms median (2.75× faster on L4).
Ampere A100 scaling: 47.65× baseline (heavy) — 1.3724 ms median (1.81× faster on A100).

## Failure modes

- Wrong units for fetch or wind speed give implausibly tall or flat seas
- Using a non-directional spectrum yields waves travelling in all directions
- Missing short-wave cutoff produces noisy capillary-scale aliasing on the grid
- Single wind-driven spectrum ignores swell from distant storms
- Peak enhancement gamma set too large produces an unnaturally regular, almost monochromatic sea

## Engine support

- blender: builtin — `Ocean modifier > Spectrum = Established Ocean (Sharp Peaks) or Shallow Water` (evidence: https://docs.blender.org/manual/en/5.2/modeling/modifiers/physics/ocean.html, checked 2026-12-01)

## Dataflow

- Inputs: material-params
- Outputs: texture
- Platforms: webgl2, webgpu, desktop-gpu, cuda, unity, unreal, houdini, blender

## Presets

### Ocean waves synthesized from a JONSWAP spectrum (sum-of-cosines toy, not FFT) (glsl-fragment; rendered 2026-11-29)

```json
{
  "N_WAVES": 28,
  "PEAK_W": 1.1,
  "ALPHA": 0.0081,
  "GAMMA": 3.3
}
```

```glsl
// Ocean surface synthesized from a JONSWAP frequency spectrum: each wave component has
// amplitude sqrt(2 S(w) dw), wavenumber k = w^2/g (deep-water dispersion), random phase and direction.
const int N_WAVES = 28;
const float GRAV = 9.81;
const float PEAK_W = 1.1;
const float ALPHA = 0.0081;
const float GAMMA = 3.3;

float hash(float n) { return fract(sin(n * 127.1) * 43758.5453); }
float jonswap(float w) {
  float sg = w <= PEAK_W ? 0.07 : 0.09;
  float r = exp(-(w - PEAK_W) * (w - PEAK_W) / (2.0 * sg * sg * PEAK_W * PEAK_W));
  return ALPHA * GRAV * GRAV / pow(w, 5.0) * exp(-1.25 * pow(PEAK_W / w, 4.0)) * pow(GAMMA, r);
}
float height(vec2 p, float t) {
  float h = 0.0; float dw = 2.6 / float(N_WAVES);
  for (int i = 0; i < N_WAVES; i++) {
    float fi = float(i);
    float w = 0.6 + (fi + hash(fi)) * dw;
    float a = sqrt(2.0 * jonswap(w) * dw);
    float k = w * w / GRAV;
    float th = (hash(fi * 3.7 + 1.0) - 0.5) * 2.2;
    h += a * cos(k * dot(vec2(cos(th), sin(th)), p) - w * t + 6.2832 * hash(fi * 7.3 + 2.0));
  }
  return h;
}
vec3 sky(vec3 d) {
  vec3 sd = normalize(vec3(0.3, 0.25, -1.0));
  vec3 c = mix(vec3(0.8, 0.85, 0.9), vec3(0.2, 0.4, 0.75), pow(clamp(d.y, 0.0, 1.0), 0.45));
  return c + vec3(1.0, 0.85, 0.6) * pow(max(dot(d, sd), 0.0), 200.0) * 6.0;
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = (fragCoord - 0.5 * iResolution.xy) / iResolution.y;
  vec3 ro = vec3(0.0, 4.0, 0.0);
  vec3 rd = normalize(vec3(uv.x, uv.y - 0.1, -1.0));
  vec3 col = sky(rd);
  if (rd.y < -0.002) {
    float t = (ro.y - 2.5) / -rd.y; float dt = 0.4; float tp = t;
    bool hit = false;
    for (int i = 0; i < 90; i++) {
      vec3 p = ro + rd * t;
      if (p.y < height(p.xz, iTime)) { hit = true; break; }
      tp = t; dt = max(0.4, t * 0.05); t += dt;
    }
    if (hit) {
      float a = tp, b = t;
      for (int i = 0; i < 6; i++) {
        float m = 0.5 * (a + b); vec3 p = ro + rd * m;
        if (p.y < height(p.xz, iTime)) b = m; else a = m;
      }
      t = b; vec3 p = ro + rd * t; float e = 0.05 + 0.01 * t;
      float h0 = height(p.xz, iTime);
      vec3 n = normalize(vec3(h0 - height(p.xz + vec2(e, 0.0), iTime), e, h0 - height(p.xz + vec2(0.0, e), iTime)));
      float f = 0.02 + 0.98 * pow(1.0 - max(dot(n, -rd), 0.0), 5.0);
      vec3 water = vec3(0.01, 0.07, 0.1) + vec3(0.04, 0.12, 0.1) * clamp(p.y * 0.5 + 0.5, 0.0, 1.0);
      col = mix(water, sky(reflect(rd, n)), f);
      col = mix(col, sky(vec3(rd.x, 0.02, rd.z)), 1.0 - exp(-t * 0.004));
    }
  }
  col = 1.0 - exp(-col * 1.3);
  fragColor = vec4(pow(col, vec3(1.0 / 2.2)), 1.0);
}

```

Attribution: written for this index

## Lineage

- extended by [FFT Ocean (Tessendorf)](https://texelatlas.vercel.app/t/fft-ocean.md)

## Combines with

- [FFT Ocean (Tessendorf)](https://texelatlas.vercel.app/t/fft-ocean.md): Supplies the initial h0(k) amplitudes whose time evolution the FFT then evaluates.

## Sources

1. [primary] Christopher J. Horvath (2015) Empirical directional wave spectra for computer graphics. Proceedings of the 2015 Symposium on Digital Production. https://doi.org/10.1145/2791261.2791267 (verified via crossref on 2026-11-29)
2. [primary] Jerry Tessendorf Simulating Ocean Water. SIGGRAPH Course Notes 2001/2004. https://jtessen.people.clemson.edu/reports/papers_files/coursenotes2004.pdf (verified via http on 2026-11-29)

## Cite this entry

Texel. "JONSWAP Wave Spectrum." https://texelatlas.vercel.app/t/jonswap-spectrum/ (accessed 2026-12-01).
