Feature Library

Shared frame uniforms

1.58 GPU · 2.48 CPU ms
A still of the Shared frame uniforms demo
Still
The live demo starts when it’s in view.Toggle “Globals in the frame group” and watch the checks and the CPU time

Global values (time, wind, sun, fog) in three’s frame group instead of every object’s: checked once a render instead of once per drawn object and pass.

What it costs a frame

1.58 ms
2.48 ms
GPU
1.58 ms
CPU, median
2.48 ms
CPU, 95th pct
4.94 ms
Draw calls
1197
Weight
Heavy

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: 1,200 objects, each with its own material reading 24 global uniforms, measured with the globals in the frame group. The same scene with plain uniform()s, measured right after on the same machine: CPU 7.5–10.4 ms a frame against 4.8–6.9 ms shared, and GPU 1.2 ms against 0.7 ms (fewer uniform uploads). The badge is the 1,200 draws’ cost, not the technique’s. 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.582.484.94
apple · Apple A19 Proin a browser tab · 16 November 20267.943.744.12
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20261.835.536.15

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. Scenes with many drawn objects
  2. World-wide wind, time, weather and fog
  3. Cut-away focus points
  4. Cutting CPU time per draw

Pitfalls, in brief

  1. Only for values that hold for the whole render: not per-object values (onObjectUpdate), not ones that differ by pass or camera (renderGroup), and not uniforms a compute shader reads (it may be dispatched twice in one frame).
  2. Make a shared uniform once, outside any Fn: a Fn runs again for every material built, so a uniform or reference() made inside it is a new one each time and the whole shared group becomes per material.
  3. A uniform’s group is one bind group per render context and per exact set of uniform nodes: materials share a frame group only if they read the same set.
  4. Three’s own light uniforms (colour, reach, decay, cone) sit in each material’s render group: lightUniformsPerFrame moves them to the frame group.
  5. The win is per drawn object: with few objects it is small.
5 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.

uniformsframeGroupcpu costdraw callstslthree internals

Near it in the frame