# FFT ocean surface

A displaced ocean surface driven by a real inverse FFT. A Phillips spectrum evolves in frequency space, two compute passes run a shared-memory radix-2 IFFT into a displacement field, and a procedural grid rides it with per-pixel normals, foam and a Fresnel sky reflection under a tunable sunset. Orbit with the mouse; tweak the sea from the panel.

## Download

Download the complete verified example source:

```bash
npx vgpu examples pull fft-ocean-surface --out ./fft-ocean-surface
```

## Explore

- [Interactive example](https://vgpu.sh/examples/fft-ocean-surface)
- [Fullscreen preview](https://vgpu.sh/preview/fft-ocean-surface)
- [Complete source](https://vgpu.sh/examples/fft-ocean-surface/source.md)

## Included files

- `index.tsx`
- `renderer.ts`
- `scene.ts`
- `params.wgsl`
- `fft-core.wgsl`
- `fft-row.wgsl`
- `fft-col.wgsl`
- `bake.wgsl`
- `spectrum-init.wgsl`
- `spectrum-update.wgsl`
- `sky.wgsl`
- `skydome.wgsl`
- `ocean-surface.wgsl`
- `composite.wgsl`
