NatureGL Riverv1.0.0

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

js
water.setParam('water.clarity', 1.4);   // by path
water.params.light.elevation = 20;      // params is live
water.getParams();                      // deep copy, in preset format

update() 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

ParamclearRange used by presetsWhat 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
scatterDensity0.280.28 – 2.4How fast in-scatter builds up with thickness
clarity1.10.8 – 1.1Divides absorption and scattering. The demo slider runs 0.3 – 2.5
flow1.00.25 – 1.6Global speed multiplier for every river, lake drift and floater
caustics1.00.12 – 1.0Caustic strength on patched materials
foam1.00.3 – 1.5All foam: shoreline, banks, rapids, obstacles, plunges
turbulence1.00.3 – 1.5Rapids: roughness and foam from speed and slope
normalStrength1.00.55 – 1.2Ripple normal amplitude
refraction1.00.5 – 1.0Refraction offset of the bed
reflectivity1.00.9 – 1.15Scales the Fresnel reflection
wetness1.01.0 – 1.3The wet band on patched materials
horizonHeight0.220.22 – 0.26Height 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.

ParamclearWhat it does
elevation55Sun elevation in degrees
azimuth14Sun azimuth in degrees. 0 is toward −z, 90 toward +x
sunColor'#fff6e6'Sun colour, for the water and the bound DirectionalLight
sunIntensity3.2DirectionalLight intensity
skyTop'#4a86d4'Zenith colour of the dome and the reflections
skyHorizon'#c2dcee'Horizon colour of the dome
fogColor'#adcadc'FogExp2 colour
fogDensity0.0065FogExp2 density
hemiSky'#c4dcff'Bound HemisphereLight sky colour
hemiGround'#44552f'Bound HemisphereLight ground colour
hemiIntensity1.05Bound HemisphereLight intensity
horizonColor'#1e3214'Colour of the tree line in reflections
lightAmount1.0Scales in-scatter and foam brightness. 0.16 at night
exposure1.0renderer.toneMappingExposure, when manageExposure is on
clouds0.75Cloud amount on the built-in dome
stars0Star field on the built-in dome

#Preset metadata

Field
nameThe preset's key, e.g. 'clear'
labelA 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:

OptionRiverLake
normalScale10.55Multiplies normalStrength
foamScale10.6Multiplies foam
calm—1Suppresses the standing-wave layer, 0 – 1
drift—(0.03, 0.05)Lake surface drift in m/s