Wave Boxes (big, curling and breaking waves)
What it is
TidalWaveBox shapes the water inside a box into large authored waves on top of the ocean:
rolling swells, curling barrels that break, an endless surf set, or a single triggered wave
(tsunami, set piece). The box’s scale is its footprint - X across, Z along travel - and
the blue Z arrow is the direction the waves move. Edges fade into the surrounding sea.
How to add it
GameObject > Tidal 2 > Wave Box - placed 30 m in front of the Scene camera at height 0,
sized for the default wave (224 m across, 429 m along). Move it to the water height, rotate it
about Y to aim the waves, enter Play mode.
In the editor
The inspector has two views, Simple (the controls that shape the wave) and Full (every setting in sections). Hidden settings keep applying in Simple view.
Screenshot: Tidal Wave Box with the Simple tab active. Mode “Consecutive”. Wave - Amplitude 3.31, Wavelength 68.5, Speed 9. Curl - Steepness 3, Lean 2, Break Point 1. Crest Foam - Crest Foam 0.25, Whitewash 0.744. A yellow warning: “Steepness product QkA = 0.91 - below 1 this is still a plain height field and will not curl. Raise Steepness or Amplitude, or shorten the Wavelength.” A note says curl detail, pull back, foam detail, scoping and debug views are under Full.
Screenshot: the Full tab: Shape “Box” and collapsed sections Wave, Curl, Break, Pull Back, Foam, Playback, Advanced.
Screenshot: Full view with Wave open - Mode Consecutive, Amplitude 3.31, Trough Factor 1, Wavelength 68.5, Speed 9, Time Offset 0, Body Waves 0.341 (how much of the background ocean stays on the wave) and the QkA warning - and Curl open - Steepness 3, Lean 2, Crest Sharpness 2.11, Normal Smoothing 0, Lip Thickness 0, Lip Reach 6, Back Steepness 1, Back Push 0, Debug View Off.
Screenshot: Pull Back - Uv Seam Width 0.2, Uv Pull Distance 0.45, Pull Back Start 1. Foam - Crest Foam 0.25, Whitewash 0.744, Foam Trail 15.47, Evaporate Type “Patchy”, Evaporate 0, Foam Offset 0, Foam Lead 21.8, Foam Fade Curve 3.45, Carry Surface Foam 1.
Screenshot: Break - Break Point 1, Break Length 20, Broken Height 0.6 and Whitewash 0.45 (greyed until Break Point is below 1), with the note “Break Point is 1 - the wave rolls through and never breaks. Lower it to break the wave along its path.” Playback - “Playback applies to Single Wave mode. Consecutive waves run on scene time.” Advanced - Edge Fade 0.188, Trough Ease 1.7, Affected Bodies (0), Affected Layer Mask Everything, and a note that whitewash is composited per screen so it cannot be scoped per body.
Screenshot (Scene view, Demo_BreakingWaves): a long stretch of sea beside a sandy beach. Rows of parallel breaking waves with white foam crests roll toward the shore; the selected wave box’s yellow outline and gizmo sit among them, and another box and a whirlpool funnel are visible further along.
Screenshot (Game view, Demo_BreakingWaves): from just above the water, a wave pitching forward: a dark blue lip curls over the crest above foamy, churning water, under a bright sky.
Screenshot (Game view, Demo_BreakingWaves): looking along the coast from above: a series of long parallel swells from the wave boxes roll toward a sandy beach, white water breaking on their faces.
Whitewash is always procedural in v2.2; animated whitewash sheets were removed. Break settings are now four controls: Break Point, Break Length, Broken Height, and Whitewash. Crest Foam defaults to 0.25, down from 2.
Key ideas
| Setting | Meaning |
|---|---|
| Mode | Consecutive - endless set; Single Wave - one wave crossing on a playhead (Play / Pause / Stop, Play On Awake) |
| Steepness x Amplitude x k | Q*k*A above 1 overturns into a barrel. The inspector shows the number |
| Lean / Lip Reach | How far the lip throws forward; warning if it reaches the next wave |
| Break Point | 1 = never breaks; lower = breaks along the box (unlocks Break Length, Broken Height, Whitewash) |
| Body Waves | How much ocean chop rides on the wave |
| Edge Fade | Soft blend into the sea at the box edges |
| Affected Bodies | Non-empty = only these bodies (exclusive) |
For a smooth curl, turn on the body’s Tessellation (Core) with a small target edge.
Floating objects use Ride Under Curls on TidalBuoyancy to sit on the barrel face.
Scripting
box.Mode = TidalWaveBoxMode.SingleWave;
box.Play(); box.Pause(); box.Stop();
box.Playhead = 0.5f; // 0..1 along the run
bool rolling = box.IsPlaying;
float seconds = box.Duration;
bool curls = box.SteepnessProduct > 1f;
float w = box.WeightAtXZ(new Vector2(x, z)); // 0 outside .. 1 inside
bool inAir = box.InAirPocket(pos);
bool cameraInBarrel = TidalWaveBox.ViewerInAirPocket;
Common issues
| Symptom | Cause | Fix |
|---|---|---|
| Rolling bump, never curls | QkA < 1 | Raise Steepness/Amplitude or shorten Wavelength |
| Faceted curl | Mesh too coarse | Body Tessellation on |
| Single Wave never moves | Not started | Play On Awake or Play() |
| Never breaks | Break Point 1 | Lower it |
| Waves go the wrong way | Box facing backwards | Rotate 180 degrees about Y |
| Hard seam at box edge | Edge Fade too small | Raise Edge Fade |