OceanSim is a real-time, physically based ocean surface for Unity.
The water is generated from a Fast Fourier Transform (FFT) height field driven by a Phillips spectrum.
The simulation runs entirely on the CPU but is multi-threaded through Unity Jobs and Burst, and exposes utility functions for sampling height and normal so that boats or other rigid bodies can float convincingly on the dynamic surface.
- Spectral Wave Synthesis – Deep-water waves generated from a Phillips spectrum and evolved in the frequency domain
- 2-D Inverse FFT Each Frame – Real-time height, slope-x, and slope-z fields reconstructed on the CPU
- Unity Jobs + Burst – Multi-core parallelism without requiring compute-shader support
- Tileable Ocean Plane – Automatic instancing of surrounding tiles for an endless horizon
- Artist-Friendly Controls – Wind speed, amplitude, chop, resolution, and colour gradients exposed in the inspector
-
Clone the repository;
-
Open the project in Unity (recommended version:
2022.3.22f1). -
Open the
OutdoorsSceneinAssets/Scenes. -
Press
Playto start the simulation.