Reference
Preset parameters
A preset is a water block and a light block. These are all of their fields, with the values of the clear preset. Every numeric field and every colour eases when it changes.
#Setting parameters
water.setParam('water.clarity', 1.4); // by path
water.params.light.elevation = 20; // params is live
water.getParams(); // deep copy, in preset formatupdate() eases the displayed values toward params: water values settle within about 0.3 s and lighting within about 1.5 s. Colours are CSS hex strings in sRGB. Absorption and scatter are linear-RGB arrays.
#water
| Param | clear | Range used by presets | What it does |
|---|---|---|---|
absorption | [0.42, 0.055, 0.075] | up to [1.2, 1.45, 1.9] | Beer–Lambert absorption per metre at clarity 1, per RGB channel |
scatterColor | [0.01, 0.13, 0.125] | Colour of light scattered inside the water | |
scatterDensity | 0.28 | 0.28 – 2.4 | How fast in-scatter builds up with thickness |
clarity | 1.1 | 0.8 – 1.1 | Divides absorption and scattering. The demo slider runs 0.3 – 2.5 |
flow | 1.0 | 0.25 – 1.6 | Global speed multiplier for every river, lake drift and floater |
caustics | 1.0 | 0.12 – 1.0 | Caustic strength on patched materials |
foam | 1.0 | 0.3 – 1.5 | All foam: shoreline, banks, rapids, obstacles, plunges |
turbulence | 1.0 | 0.3 – 1.5 | Rapids: roughness and foam from speed and slope |
normalStrength | 1.0 | 0.55 – 1.2 | Ripple normal amplitude |
refraction | 1.0 | 0.5 – 1.0 | Refraction offset of the bed |
reflectivity | 1.0 | 0.9 – 1.15 | Scales the Fresnel reflection |
wetness | 1.0 | 1.0 – 1.3 | The wet band on patched materials |
horizonHeight | 0.22 | 0.22 – 0.26 | Height of the dark tree line in reflections |
#light
These drive the built-in sky and bound lights. With an external sky, the sun, reflections and fog colour come from the sky instead.
| Param | clear | What it does |
|---|---|---|
elevation | 55 | Sun elevation in degrees |
azimuth | 14 | Sun azimuth in degrees. 0 is toward −z, 90 toward +x |
sunColor | '#fff6e6' | Sun colour, for the water and the bound DirectionalLight |
sunIntensity | 3.2 | DirectionalLight intensity |
skyTop | '#4a86d4' | Zenith colour of the dome and the reflections |
skyHorizon | '#c2dcee' | Horizon colour of the dome |
fogColor | '#adcadc' | FogExp2 colour |
fogDensity | 0.0065 | FogExp2 density |
hemiSky | '#c4dcff' | Bound HemisphereLight sky colour |
hemiGround | '#44552f' | Bound HemisphereLight ground colour |
hemiIntensity | 1.05 | Bound HemisphereLight intensity |
horizonColor | '#1e3214' | Colour of the tree line in reflections |
lightAmount | 1.0 | Scales in-scatter and foam brightness. 0.16 at night |
exposure | 1.0 | renderer.toneMappingExposure, when manageExposure is on |
clouds | 0.75 | Cloud amount on the built-in dome |
stars | 0 | Star field on the built-in dome |
#Preset metadata
| Field | |
|---|---|
name | The preset's key, e.g. 'clear' |
label | A human-readable name. The demo shows it as the pill's tooltip |
#Per-body settings
Some looks are per body rather than per preset. Set them when you add the body:
| Option | River | Lake | |
|---|---|---|---|
normalScale | 1 | 0.55 | Multiplies normalStrength |
foamScale | 1 | 0.6 | Multiplies foam |
calm | — | 1 | Suppresses the standing-wave layer, 0 – 1 |
drift | — | (0.03, 0.05) | Lake surface drift in m/s |