Three.js water guides
Build a game ocean and float a boat on it. Explore water on a touchscreen or in VR, map a lake from survey data, or use a tide gauge to set the waterline in a waterfront model.
Rendering and simulation
Build a reflective water shader
Put pilings in a Three.js water plane, animate the reflection and tune the effect for smaller screens.
Read guide
Light an underwater scene
Fade distant rocks into blue and project moving bands of sunlight across the sand.
Read guide
Make a river flow
Send markers down a bend and see how the current slows along the banks.
Read guideGames
Add water to your game
Start with a plain Three.js surface. Add a moving ocean when the camera or gameplay needs wave height.
Read guide
Float a boat on waves
Set the hull’s size and draft, then check how it rides the surface and responds to steering.
Read guide
Build a breaking shoreline
Use the beach terrain to calculate water depth so waves steepen over a sandbar and wash onto shore.
Read guide
Leave a wake through a turn
Follow a boat’s path through a turn and keep the older foam where the hull left it.
Read guideInteractive experiences and VR
Make ripples with a tap
Turn a touch or mouse click into a splash at the corresponding spot on the water.
Read guide
Stand on a pier in WebXR
Build a stationary waterfront scene with a desktop view and an immersive VR session on supported devices.
Read guide
Hear the waterline
Move the listener through the surface and hear the high frequencies fade underwater.
Read guideVisualization
Model a waterfront
Raise the water beside a quay, then switch from the overhead view to eye level to see how much of the landing stays dry.
Read guide
Draw a lake from GeoJSON
Turn a shoreline polygon into a water mesh and cut out its islands using the interior rings.
Read guide
Map the seabed
Turn a grid of depth soundings into a bathymetric map, then click the channel to read its depth.
Read guide
Plot tide gauge data
Scrub through 24 hourly readings from San Francisco and plot their heights against a tidal datum.
Read guide
Render a swimming pool
Look down to see the tiled floor, then move to the pool’s edge to catch the courtyard reflection.
Read guide