Reference
Water parameters
Every key of WaterParams, the object presets are made of. Set any of them with setParams, and read the eased values from water.current.
water.setParams({ wind: 12, foam: 1.4 }); // eased toward the new targets
water.setParams({ time: 6 }, { instant: true }); // snap
water.params.wind; // the target
water.current.wind; // the eased value in use right now (read these for UI sliders)Every numeric param, the absorption and scattering triples, time and windDirection ease toward their targets over about 1.5 s. time and windDirection take the short way round.
#Sea
| Key | Default | Meaning |
|---|---|---|
wind | 6 | Wind speed, m/s. Hs = min(0.21 U²/g, L/12) + 0.08, chop = 0.38 + U/32 |
wavelength | 32 | JONSWAP peak wavelength, m |
windDirection | 216.87 | Direction the waves travel toward, degrees (0 = +X, 90 = +Z) |
choppiness | 1 | Multiplier on the wind-derived steepness (0–1.5) |
See Waves, wind and foam.
#Foam and shore
| Key | Default | Meaning |
|---|---|---|
foam | 1 | Whitecap amount |
foamPersistence | 4 | Seconds for whitecap foam to fade, × (0.5 + wind / 20) |
shoreFoam | 1 | Breaker, swash and contact-line foam |
shoreWaves | 1 | Breaker amplitude. 0 disables shore waves |
shoreSteepness | 0.92 | 1.1 Crest steepness (Q·k·a) the shore trains reach where they break, 0–1 |
See Shorelines.
#Water body
| Key | Default | Meaning |
|---|---|---|
absorption | [0.42, 0.075, 0.05] | Beer–Lambert absorption per metre, RGB |
scattering | [0.004, 0.05, 0.085] | In-scatter per metre, RGB |
underwaterFog | 0.03 | Underwater fog density, per metre |
caustics | 1 | Caustics on patched materials and in the light shafts |
#Surface shading
| Key | Default | Meaning |
|---|---|---|
glitter | 1 | Sun specular |
sss | 1 | Crest subsurface scattering |
reflections | 1 | Screen-space reflection strength, 0–1 |
refraction | 1 | Refraction distortion and depth blur |
#Sky
These drive the built-in sky only. fogDensity also fogs the water, and scene.fog with manageFog.
| Key | Default | Meaning |
|---|---|---|
time | 14.5 | Hour of day, 0–24 |
clouds | 0.32 | Cloud cover 0–1. Also dims the sun |
cloudDarkness | 0 | Storm darkening 0–1 |
overcast | 0 | Sky desaturation 0–1 |
fogDensity | 0.00032 | Exponential-squared aerial perspective, per metre |
See Sky and lighting.
#Output
| Key | Default | Meaning |
|---|---|---|
exposure | 1 | Composite exposure. With an external sky that has displayExposure, a multiplier on it |
bloom | 0.45 | Bloom strength |
bloomThreshold | 1.6 | Bloom threshold, linear HDR |
#Labels
| Key | |
|---|---|
name | Optional preset id |
label | Optional display name |
The library doesn't read either. The demo's buttons use their own labels.