Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdf78e4f826

README.md

oceanPreset

A complete sea state for the ocean system: everything ocean.create needs to stand up a specific sea, from the wave spectrum to the seabed under it. Each .data instance is one named preset offered in the ocean's preset list.

Fields

  • key — the name the preset answers to in ocean.create({ preset = ... }) and the presets API. Stable; world content refers to it.
  • label — the human-readable name shown in pickers.
  • order — the preset's slot in the calm-to-gale progression the list is offered in (1 = flattest).
  • seed — the spectrum's random seed.
  • waves — the FFT spectrum: wind speed and direction, choppiness, gravity, JONSWAP gamma, spectral sharpness, standing-wave ratio, animation speed, and a global amplitude on top.
  • cascades — the three simulation bands: per-band enable, amplitude and world-space tile scale in metres.
  • gerstner — the analytic long swell layered under the FFT bands: wavelength and its spread, amplitude, wave count, directional spread.
  • clipmap — the surface mesh: base tile size in metres and ring count.
  • color — the water column: absorption rates authored as a hex triple (decoded to per-channel 1/m extinction), transmission and body colours, and the depth assumed where nothing stands behind the water.
  • fresnel — the mirror: distance fade start/power, index-of-refraction ratio, normal strength, screen-space refraction strength.
  • foam — the three layers: surface lace, waves whitecaps (with persistence, optional breaking window and placement mask), and the shoreline wash.
  • floor — the procedural seabed and its caustics web.
  • shore — how deep the bottom starts taking the waves (shoalDepth, metres); omitted, the ocean's default shoaling band applies.
  • sss — subsurface scattering through backlit crests.
  • ssr — screen-space reflections.
  • sparkle — the sun's specular glint.

Colour-valued fields are authored as #rrggbb strings and decoded to linear RGB by Presets.color on the way to the GPU — including absorptionColor, whose channels are extinction rates rather than a colour.