Water that moves like a river, and that the things floating on it can feel.
Most water in three.js is a scrolling texture or an open-ocean system. river3d is built for the harder case: shallows, currents, eddies, rapids and waterfalls. It's a real fluid simulation running on the GPU, built on three.js's WebGPURenderer and TSL.
Shallow-water flow is simulated on the GPU around the camera. Water follows the riverbed: fast through the narrows, slow in the pools, curling into eddies behind rocks.
Rafts, leaves and sticks all read the same live water. Heavier bodies push back, so wakes and splashes move the things around them.
Nothing is hand-placed. Leaves get caught and circle, and a waterfall's plunge pool drags things back toward the falls.
Wind with direction, speed and gusts. Chop grows with open water upwind, so sheltered bays stay calm while open water roughens.
Open a sluice and the river surges, then settles. Gates, plugs and dams change the flow live.
Thousands of leaves ride the surface, simulated on the GPU.
Dive below and look up through the surface, with caustics and an underwater look.
Toon shading bands, ink outlines and foam lines, written in TSL so it keeps working as three.js updates.
Shading bands, outline width, chop height, wind and ripple strength, all adjustable at runtime.
Further looks are in development.
With a WebGL2 fallback: where WebGPU isn't available, the water runs on the CPU in a worker.
From handheld to high-end desktop. Trade water area, detail, particle count and reflections for frame rate.
Designed to hit 60 fps at 1080p on a MacBook Air, with a benchmark harness that measures every change.
Describe a river network (forks, merges, lakes, rocks, falls) and the tooling carves the terrain and pre-solves the flow, so the water is settled when the scene loads.
See flow, depth, speed, foam and wind at a glance.
river3d is in development. Check back here for the launch.