Tidal 2 URP

Wave Simulation: FFT and Gerstner

What it is

A body’s waves come from a simulation component in its T Compute field:

ComponentUseProfile asset
TidalFFTComputeBest quality ocean spectrum (swell + local wind), 3 cascadesTidalProfile
TidalGerstnerComputeCheapest: a hand-authored list of waves for stylised or lower-cost seas; mobile is untestedTidalProfileGerstner

One compute can drive many bodies; each body still has its own Wave Strength. Profiles are shared assets - duplicate one before editing if other bodies use it.

Wave Strength moved from the compute to the body in v2.2. Old scenes convert automatically; TidalFFTCompute.Strength is obsolete. New Gerstner profiles start from the demo sea.

How to add it

  • The Ocean / Lake menus add a TidalFFTCompute with a profile.
  • Gerstner: Add Component > TidalGerstnerCompute, assign a profile, then set the body’s T Compute to it.
  • New profiles: Assets > Create > Tidal 2 > Water Profile FFT (Best Quality) or Assets > Create > Tidal 2 > Water Profile (Gerstner).

In the editor

FFT Compute

Tidal FFT Compute inspector

Screenshot: the Tidal FFT Compute component with an “FFT” icon and a TIDAL Compute banner (v2.2.0, Doc). Compute Settings: Size “128 (Performant)”, Tidal Profile TidalProfile_Default, Is Dynamic (on), Compute Hz 60. A collapsed FFT Debug Views foldout sits below.

FieldMeaning
SizeFFT resolution per cascade. Changeable live in Play mode. Lower = faster
Tidal ProfileThe wave spectrum asset
Compute HzSimulation update rate

FFT profile (TidalProfile)

FFT profile asset

Screenshot: the TidalProfile_Default asset. Wave Scales (meters): Length Scale (Cascade 0) 263.5, (Cascade 1) 17, (Cascade 2) 5. FFT Compute: Gravity 9.81, Depth 500, Lambda 1 (chop). A two-tab toggle Swell | Local Wind; the Swell tab shows Amplitude 1, Wind Speed 3, Direction 31, Fetch 300000, Directional Spread 1, Swell 1, Peak Sharpness 5.57, Short Waves Fade 0.03. At the bottom, FFT Preview (512^2) for Length Scale 0 - a warning that it runs the full GPU FFT in the editor, Pause and resolution buttons, a side-on slice graph of the wave with a 1 m grid, and Preview Zoom.

Wave direction comes from Direction (degrees). Rough seas: raise Wind Speed and Amplitude; calmer: lower them or lower the body’s Wave Strength.

Gerstner Compute

Tidal Gerstner Compute inspector

Screenshot: the Tidal Gerstner Compute component (a blue sine-wave icon): Script, Size “128 (Performant)”, Profile TidalProfileGerstner_Demo, Compute Hz 60. Size 256-512 is recommended for Gerstner.

Gerstner profile (TidalProfileGerstner)

Gerstner profile asset

Screenshot: TidalProfileGerstner_Demo. Tile Size 128, Grav Const 9.81, Depth 500, Lambda 1, Speed Multiplier 1. Waves (5) with +/- buttons and Overall Scale 0.78. Five waves of 61, 37, 23, 13 and 8 m, each with an amplitude slider and its own Wavelength, Direction Deg, Steepness (0.55-0.7) and Phase Deg. A tick “Edit wavelength / direction / steepness / phase”. Water Detail Normal Map box: a baked pinkish normal-map thumbnail, Map, Resolution 512, Tile Size (m) 12; Ripples - Richness 132, Coarse/Fine 1.674, Direction Spread 0.65, Use Sea Direction (on), Bake Steepness 1, Seed 0; a Re-generate Normal Map button; On The Water - Strength 0.38, Scroll Speed 0.35.

New Gerstner profiles start with this 61-8 m demo set. Waves shorter than about TileSize / Size * 4 metres look blocky - put fine ripples in the baked normal map instead.

Gerstner sea in play mode

Screenshot (Game view, Demo_Gerstner): a soft blue Gerstner sea with long rolling swells and a glint of sun reflection in the foreground, under a hazy cloudy sky.

Scripting

TidalMeshSharedSettings settings = body.GetTidalMeshSettings();
var gerstner = body.gameObject.AddComponent<TidalGerstnerCompute>();
gerstner.ActiveGerstnerProfile = gerstnerProfile;
gerstner.Size = ComputeTidalSize.W256;
settings.TCompute = gerstner;

var fft = body.GetComponent<TidalFFTCompute>();
TidalProfile current = fft.ActiveTidalProfile;

Common issues

SymptomCauseFix
Editing a profile changed every bodyProfiles are sharedDuplicate and assign the copy
Second body has no wavesIts T Compute is emptyPoint it at the existing compute
No Strength slider on the computeMoved to the body in 2.2Body > Core > Wave Strength
Gerstner looks blockyWaves too short for SizeRemove waves under ~8 m or raise Size
Gerstner turns white everywhere after raising SizeShort steep waves now foldRemove them or lower Steepness
Gerstner glassy up closeNo ripple mapGenerate Normal Map, Strength ~1