NatureGL Waterv1.1.0

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.

js
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

KeyDefaultMeaning
wind6Wind speed, m/s. Hs = min(0.21 U²/g, L/12) + 0.08, chop = 0.38 + U/32
wavelength32JONSWAP peak wavelength, m
windDirection216.87Direction the waves travel toward, degrees (0 = +X, 90 = +Z)
choppiness1Multiplier on the wind-derived steepness (0–1.5)

See Waves, wind and foam.

#Foam and shore

KeyDefaultMeaning
foam1Whitecap amount
foamPersistence4Seconds for whitecap foam to fade, × (0.5 + wind / 20)
shoreFoam1Breaker, swash and contact-line foam
shoreWaves1Breaker amplitude. 0 disables shore waves
shoreSteepness0.921.1 Crest steepness (Q·k·a) the shore trains reach where they break, 0–1

See Shorelines.

#Water body

KeyDefaultMeaning
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
underwaterFog0.03Underwater fog density, per metre
caustics1Caustics on patched materials and in the light shafts

See Underwater and caustics.

#Surface shading

KeyDefaultMeaning
glitter1Sun specular
sss1Crest subsurface scattering
reflections1Screen-space reflection strength, 0–1
refraction1Refraction distortion and depth blur

#Sky

These drive the built-in sky only. fogDensity also fogs the water, and scene.fog with manageFog.

KeyDefaultMeaning
time14.5Hour of day, 0–24
clouds0.32Cloud cover 0–1. Also dims the sun
cloudDarkness0Storm darkening 0–1
overcast0Sky desaturation 0–1
fogDensity0.00032Exponential-squared aerial perspective, per metre

See Sky and lighting.

#Output

KeyDefaultMeaning
exposure1Composite exposure. With an external sky that has displayExposure, a multiplier on it
bloom0.45Bloom strength
bloomThreshold1.6Bloom threshold, linear HDR

#Labels

Key
nameOptional preset id
labelOptional display name

The library doesn't read either. The demo's buttons use their own labels.