A surface for source's particles.
ReadonlylightingSun and sky light.
ReadonlyobjectAdd this to your scene: the full-screen composite (drawn after the opaque scene, it reads its colour and depth).
Resolved settings.
ReadonlyuniformsShader uniforms.
Absorption per metre.
Blur direction (texels).
Edge thickness.
Fresnel F0.
Foam amount.
Foam colour (linear).
Foam opacity per metre.
Foam speeds.
Ground (linear).
Sky horizon (linear).
1/Δx of the source.
Mist opacity.
Mist width, metres.
Projection [0][0] and [1][1].
Sphere radius, metres.
Refraction.
Camera right, world.
Roughness.
Scatter colour (linear).
Shutter, seconds.
Smoothing radius, metres.
Spray node-mass thresholds.
Streak contrast.
Radius multiplier of tagged particles.
One texel of the offscreen passes.
Seconds (streak animation).
Turbidity per metre.
Camera up, world.
Thickness scale: particle volume over sphere volume (overlapping spheres would overcount).
Sky zenith (linear).
Frees the GPU resources.
Draws the offscreen passes for camera (call each frame before rendering the scene that holds object).
Merges input into the settings.
Optionalabsorption?: [number, number, number]Beer–Lambert absorption of the water, per metre (linear RGB): pure water loses red first.
Optionaledge?: numberWater thickness (m) over which the rim of the water fades in (anti-aliased edges; a thin film is still a reflecting surface).
Optionalfoam?: numberMost whitewater coverage, 0…1.
OptionalfoamColor?: stringColour of whitewater (aerated, fast or broken water), #rrggbb.
OptionalfoamDensity?: numberHow opaque aerated water gets per metre of thickness (whitewater is translucent where thin).
OptionalfoamSpeed?: [number, number]Speeds (m/s) over which water turns to whitewater: none below the first, all above the second.
Optionalior?: numberIndex of refraction (sets the Fresnel reflectance; 1.333 for water).
Optionaliterations?: numberSmoothing passes (each a horizontal and a vertical blur), 0…4.
Optionalmist?: numberOpacity of one spray particle's mist.
OptionalmistSize?: numberWidth of a spray particle's mist, in particle spacings.
Optionalradius?: numberParticle sphere radius, in particle spacings (Δx/2). About 1 makes neighbours overlap into one surface.
Optionalrefraction?: numberHow far the background shifts through the surface, per metre of water thickness (screen fraction).
Optionalresolution?: numberResolution of the offscreen passes relative to the drawing buffer (0.25…1).
Optionalroughness?: numberMicrofacet roughness of the sun highlight (0.02 glassy … 0.3 rippled).
OptionalscatterColor?: stringColour of the in-scattered light (silt, algae), #rrggbb.
Optionalshutter?: numberExposure time of the mist's motion blur, seconds (streak length = speed × shutter).
Optionalsky?: [string, string, string]Reflected sky when no envMap: zenith, horizon and ground colours, #rrggbb (scaled by the lighting's ambient).
Optionalsmoothing?: numberDepth smoothing radius, in particle radii (world space; the bilateral filter keeps silhouettes).
Optionalspray?: [number, number]Spray: water where the solver's grid is nearly empty (a node mass of a full cell of 1000 kg/m³ = 1) is drawn as soft mist, not as surface; all mist below the first value, all surface above the second (needs a source with a grid).
Optionalstreaks?: numberContrast of the flow-aligned streaks in falling whitewater, 0…1.
OptionaltagRadius?: numberRadius multiplier of tagged particles (buffers.state.z ≠ 0, e.g. rain splashes): small drops, not blobs.
Optionalturbidity?: numberIn-scattering by suspended matter, per metre: 0 is glass-clear, tens is opaque mud within centimetres.
Replaces the reflected environment (null: the sky gradient). Rebuilds the composite material.
Screen-space fluid rendering of particles (van der Laan et al. 2009): the particles are drawn as sphere impostors into a linear depth buffer and as additive thickness splats, the depth is smoothed by a separable bilateral filter, and a full-screen pass in your scene rebuilds normals from it and shades a water surface: Fresnel reflection of the sky, a GGX sun highlight, refraction of what is behind (the scene's own colour buffer), Beer–Lambert absorption and turbid in-scattering by thickness, and whitewater where the water is fast. Thin sheets and lone drops fade out by thickness, so edges are soft. Needs the WebGPU backend.
Example