Real-Time FFT Ocean Simulation and Wave Generation in WebGPU
Evaluating Phillips and Tessendorf wave spectra using parallel 2D Fast Fourier Transform (FFT) passes in WGSL compute workgroups.
Simulating deep-water ocean waves with realistic choppy crests requires evaluating complex spatial frequency spectra. Moving Fast Fourier Transform (FFT) solvers from CPU routines to WebGPU compute dispatches yields hardware-native frame rates for expansive water surfaces.
1. Tessendorf Spectrum & Phillips Wave Generation
Generating initial frequency-domain height maps uses wind speed, direction, and fetch distance parameters inside WGSL compute shaders to evaluate statistical Phillips spectrum distribution functions.
2. Parallel 2D Radix-2 FFT Compute Passes
Transforming frequency-domain wave states into spatial displacement vectors relies on butterfly FFT compute passes, evaluating horizontal and vertical row transforms across storage textures in parallel.
3. Jacobian Choppiness & Subsurface Scattering Shaders
Calculating Jacobian determinant matrices from horizontal displacement fields detects wave crest pinching, driving dynamic foam texture generation and subsurface light scattering inside water fragment shaders.