Skip to content

eulerjs API / @eulerjs/marine / SpectralWavesOptions

SpectralWavesOptions ​

Defined in: packages/marine/src/waves/SpectralWaves.ts:11

Properties ​

PropertyTypeDescriptionDefined in
choppiness?numberHow far the surface's points move sideways toward the crests, sharpening them: 0 for none, 1 for the full Gerstner motion, more to fold the crests over. Defaults to 1.3: sharp crests, folding over at the steepest.packages/marine/src/waves/SpectralWaves.ts:21
fetch?numberHow far the wind has blown over open water, in metres. Defaults to 100 km.packages/marine/src/waves/SpectralWaves.ts:17
gravity?number-packages/marine/src/waves/SpectralWaves.ts:99
gustiness?numberHow much rougher and calmer the sea is from place to place, as the wind gusts: the waves of the patches up to gustPatches in size scaled up and down by about this much over stretches a kilometre or two across, in a pattern that never repeats. From afar, the sea's texture then varies as a real one's does, which hides the patches' repeats. 0 for an even sea. Defaults to 0.3.packages/marine/src/waves/SpectralWaves.ts:58
gustPatches?numberPatches up to this size, in metres, gust. Defaults to 150.packages/marine/src/waves/SpectralWaves.ts:60
gustScale?numberAbout how far across the gusts' stretches are, in metres. Defaults to 1500.packages/marine/src/waves/SpectralWaves.ts:62
heightScale?numberEvery wave's height times this: more than 1 for a sea larger and wilder than its wind would raise, as a storm's in a film is. Defaults to 2.05: a sea taller than its wind's, as seas in films are, waves 5.3 m high. windSpeed is the way to a rougher sea that is still a real one: from 5 m/s a calm sea, through 10 a fresh breeze's to 20 a gale's.packages/marine/src/waves/SpectralWaves.ts:28
inversionIterations?numberFixed-point steps to find the undisplaced point under a world position. Defaults to 3.packages/marine/src/waves/SpectralWaves.ts:98
loopPeriod?numberThe sea repeats exactly every this many seconds, every wave's frequency rounded to a whole number of turns in it (by at most π / loopPeriod rad/s), so that the time the waves are evaluated at can wrap round. The GPU works in single precision, so that keeps its waves to the physics' however long the sea runs: without it they would drift apart by a part in a few thousand within the hour. Infinity for no loop. Defaults to 1000 s.packages/marine/src/waves/SpectralWaves.ts:96
patchSizes?readonly number[]Edge lengths of the square patches the sea is made of, in metres, from the largest. Each holds the waves too short for the one before it and long enough for its own, and the patches tile the sea; sizes that don't divide each other keep their repeats from lining up. The smallest sets how fine the water drawn close up gets. Defaults to 512, 113, 25, 5.5 and 1.2 m: waves from half a kilometre long down to a couple of centimetres.packages/marine/src/waves/SpectralWaves.ts:70
peakEnhancement?numberJONSWAP's γ: 3.3 for a young sea, 1 for a fully grown one. Defaults to 3.3.packages/marine/src/waves/SpectralWaves.ts:19
physicsPatches?numberHow many of the patches, from the largest, the physics evaluates. Defaults to 2.packages/marine/src/waves/SpectralWaves.ts:84
physicsResolution?numberWaves across each patch the physics evaluates, a power of two no more than resolution: the physics floats on the same waves as the water mesh draws, the longest of them. Defaults to 64.packages/marine/src/waves/SpectralWaves.ts:82
resolution?numberWaves across each patch the water mesh draws, a power of two. Each patch holds only the waves from 4 to about 20 across it before the next takes over, so this matters for the smallest only: 128 takes it down to waves 2 cm long, 64 to 4 cm for a sixth less time on the GPU. Defaults to 128.packages/marine/src/waves/SpectralWaves.ts:77
seed?numberFor the random phases and amplitudes of the waves: a different seed, a different sea. Defaults to 1.packages/marine/src/waves/SpectralWaves.ts:30
shortWaveFade?numberFades the shortest waves out, the spectrum times e^(-k² ℓ²) for this length ℓ in metres (as Acerola's short waves fade): waves much shorter than 2πℓ are gone, for a smoother, glassier sea. Defaults to 0, none faded.packages/marine/src/waves/SpectralWaves.ts:43
swellAngle?numberThe way the swell runs, in radians as windAngle. Defaults to the wind's way.packages/marine/src/waves/SpectralWaves.ts:49
swellCount?numberHow many long waves the swell is made of. Defaults to 8.packages/marine/src/waves/SpectralWaves.ts:45
swellHeight?numberThe significant height of a swell running under the wind's sea, in metres: a few long waves, hundreds of metres to kilometres long, that the patches are too small to hold. They are summed where they are, not tiled, so they never repeat, and from afar they break up the patches' repeats. 0 for none. Defaults to 2.packages/marine/src/waves/SpectralWaves.ts:37
swellSpread?numberHow far, in radians either side, the swell's waves run from swellAngle. Defaults to 0.5.packages/marine/src/waves/SpectralWaves.ts:51
swellWavelengths?readonly [number, number]The shortest and longest of the swell's waves, in metres. Defaults to 200 and 1000.packages/marine/src/waves/SpectralWaves.ts:47
timeOffset?numberAdded to the time the sea is evaluated at. Defaults to 0.packages/marine/src/waves/SpectralWaves.ts:88
timeScale?numberSpeeds the sea up (> 1) or slows it down. Defaults to 1.packages/marine/src/waves/SpectralWaves.ts:86
windAngle?numberThe way the wind blows, in radians from +x toward +z, as Wind's angle. Defaults to 0.packages/marine/src/waves/SpectralWaves.ts:15
windSpeed?numberWind speed ten metres up, in m/s. Defaults to 12.5, a strong breeze.packages/marine/src/waves/SpectralWaves.ts:13

Released under the MIT License.