Feature Library
1.19 GPU · 0.26 CPU ms
A still of the Cloud shadows demo
Still
The live demo starts when it’s in view.Click the land or the map to place the marker · drag to orbit · arrow keys on the map move it

Soft shade drifting over the land with the wind, on everything the sun lights.

What it costs a frame

1.19 ms
0.26 ms
GPU
1.19 ms
CPU, median
0.26 ms
CPU, 95th pct
0.52 ms
Draw calls
13
Weight
Moderate

Measured 13 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged GPU 1.19–1.19, CPU 0.26–0.39 ms). What ran: Measured drifting at 14 m/s over a 900 m landscape: an 80,000-triangle terrain, 700 trees and 16 houses in two instanced draws, a lake lit by hand that reads the same shade through `sunAt`, a 2048² sun shadow map. Every lit pixel reads the 256² cloud field once. 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.190.260.52
apple · Apple A19 Proin a browser tab · 16 November 20264.860.440.70
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20267.140.936.82

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
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
three.js 0.187.0No other packages

What it’s for

  1. An open world or a big landscape that needs weather and life from above
  2. A flight, drone or strategy view over country, farms or a city
  3. An architectural or site model shown on a changing day
  4. Gameplay that asks whether a place is in the sun (solar panels, plants, stealth, heat)
  5. An overcast or a passing storm with no sunlit patches left
  6. Foliage, water or grass shaders that do their own lighting and should darken with the rest

Pitfalls, in brief

  1. Call shade(light) before the first render that sees the light: three makes a light’s node once, reading light.colorNode as it does, and never again.
  2. Don’t cloud the sun by registering a node on DirectionalLight itself (DirectionalLight.registerNode, as the game did): since three r187 a light’s node class lives on the light class’s prototype, so it changes every directional light on the page, in every renderer, other scenes and other widgets included.
  3. Dim the light, not the frame.
  4. A hand-lit material (gpu-foliage’s leaves, a water or grass shader of your own) never sees the light’s colour node: multiply its sun by sunAt(positionWorld), or it stays bright under the clouds.
  5. Keep the field big and slow: hundreds of metres a repeat and a few metres a second.
4 more in brief
  1. Read the field along the sun from the cloud layer, not straight down: straight down, shadows on hills and towers sit in the wrong place in a low sun, and the whole field slides wrongly when the sun moves.
  2. A debug view of the field must read it where the shade does: along the sun from the cloud layer (densityAt(positionWorld) on the GPU, fieldPoint then sampleField on the CPU).
  3. For an overcast, take the cover past 1 (to 1.15), not to 1: at exactly 1 the soft edge still leaves the field’s highest points half lit, and sunny spots drift over a land that should be all in shade.
  4. Mipmap the field and give it linear filtering: from far away an unfiltered field shimmers as the camera moves.
9 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.

cloud shadowsweatherskysunlightlandscapeterrainopen worldwinddriftovercastvalue noisetileablelight nodecolorNodetslcpu queryno passno dependencies

Near it in the frame