Feature Library

GPU rain and snow with a seeded weather model

1.33 GPU · 0.33 CPU ms
A still of the GPU rain and snow with a seeded weather model demo
Still
The live demo starts when it’s in view.Drag to orbit · click, then scroll to zoom · in Seeded days, drag the timeline to move the clock

Every drop and flake placed by its index alone, so the CPU only writes a few uniforms (about 0.01 ms a frame).

What it costs a frame

1.33 ms
0.33 ms
GPU
1.33 ms
CPU, median
0.33 ms
CPU, 95th pct
0.52 ms
Draw calls
15
Weight
Moderate

Measured 3 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Runs a downpour whatever the controls say (rain 0.9, wind 4 m/s, 20:30, the ground soaked): some 30,000 streaks and 17,000 splashes (more on a wider stage), one instanced draw each, with the rings on the pond and puddles and the wet, glossy ground. The CPU writes a few uniforms and the instance counts a frame. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool1.330.330.52
apple · Apple A19 Proin a browser tab · 16 November 20266.371.001.36
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20269.311.131.58

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
WebGPUNeeds WebGPU: current Chrome and Edge, Safari 26+, Firefox 141+ on Windows.
Your browser
Checking…Looking for WebGPU
Depends on
three.js 0.187.0No other packages

What it’s for

  1. Open-world weather
  2. Rain on water and puddles
  3. Shelters and interiors that stay dry
  4. Snow that settles and melts
  5. Day and night cycles
  6. Weather a server can own

Pitfalls, in brief

  1. Place a drop by its index and a clock in whole falls, and keep the clock short (mod 1024 falls): a whole number of falls taken off moves no drop, and float precision never runs out.
  2. Fix the drops to the world, not the view: a box on the world’s axes round the view that only resizes in 8 m steps, or turning the camera drags the rain with it.
  3. No fog on the streaks and flakes: their place comes from the stop field’s textures in the vertex stage, and three would read them again in the fragment stage, where they are not bound (the pipeline fails and nothing draws).
  4. A roof counts only where a whole cell is under it, or rain stops in the air beside a wall.
  5. Wet and snowy surfaces are a uniform branch over the material’s own colour and roughness: no new material and no new shader as the weather changes, so nothing compiles mid-run.
3 more in brief
  1. The streaks, splashes and flakes are hidden while it is dry: build their pipelines at load (warm), or the first shower stalls a frame.
  2. The uniforms and the stop field are module-wide (one weather per page), in three’s frame group: set once a frame, not per object.
  3. Streak and flake widths are world sizes tuned for a high game camera; a camera down among the drops wants them thinner (setLook({ width }), setSnowLook({ size })).
8 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

Jarzynski and Olano, “Hash Functions for GPU Rendering” (JCGT, 2020): The PCG hash that places each drop, splash, flake and ring (it replaces the game’s Dave Hoskins “hash without sine”).

FNV-1a (Fowler, Noll and Vo), MurmurHash3’s finaliser (Austin Appleby) and lowbias32 (Chris Wellons): Public-domain integer hashes whose constants seed the world and roll each day’s weather and each lightning slot.

rainsnowweatherinstancingproceduralwet surfaceslightningseededtsl

Near it in the frame