Feature Library

Segment loader

0.35 GPU · 0.47 CPU ms
A still of the Segment loader demo
Still
The live demo starts when it’s in view.Choose a segment in the strip to jump to it · lower the memory budget or raise the texture size and loading ahead waits

A long show held a few segments at a time.

What it costs a frame

0.35 ms
0.47 ms
GPU
0.35 ms
CPU, median
0.47 ms
CPU, 95th pct
2.23 ms
Draw calls
31
Weight
Light

Measured 11 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. What ran: Warm-up off; the show runs at 4× with 3 s segments, so loading, GPU preparation and releases fall inside the measured frames (2 ahead, 1024² textures, 2 ms 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 tool0.350.472.23
apple · Apple A19 Proin a browser tab · 16 November 20261.460.140.40
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20261.831.195.38

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. Live stage shows and keynotes
  2. Long linear experiences and guided stories
  3. Presentations with 3D scenes
  4. Games with chapters or levels
  5. Kiosks that run for hours
  6. Soak and heat tests in CI

Pitfalls, in brief

  1. Call loader.frame() before the frame’s own render: the draw unseen renders into the canvas (scissored to one pixel) and the real render clears it.
  2. Main-thread work in a load must go through ctx.unit(): work between awaits outside a unit runs whenever its promise resolves, unbudgeted, and can land in any frame.
  3. Lights belong to the scene, not to a segment: a light set is in every shader’s key, so a segment drawn unseen with other lights compiles shaders no frame uses.
  4. Never run two renderer.compileAsync calls at once (three r187): it keeps one precompilation state on the renderer and awaits between setting and restoring it.
  5. compileAsync covers the camera’s pass only: the draw unseen makes each new caster’s shadow shader synchronously, as one unit (5–40 ms for a new material).
6 more in brief
  1. A released segment’s pipelines are freed by three (r187) when nothing draws with them; its next load builds them again, off the frame through the prep queue.
  2. Call goTo(next) once the old segment has left the screen: with nothing kept behind, goTo releases it at once.
  3. A segment’s estimate is only a guess until it has loaded once; its measured bytes then stand.
  4. With a post-processing pipeline, pass threePrep a render that draws your scene pass: the scissor applies to the canvas, so the warm draw fills your scene target for one frame (redrawn before it is seen).
  5. Opacity 0, visibility hidden and display none are not painted: a DOM part warmed that way decodes and rasterises nothing. warmDom uses 0.4 %.
  6. Byte counts are what was asked for: Dawn on D3D12 holds small resources in power-of-two blocks of at least 64 KB (heldBytes models it); the driver may round elsewhere.
11 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.

PCG hash (Jarzynski & Olano, “Hash Functions for GPU Rendering”, JCGT 2020): the demo’s generated pictures and placements

streamingloadingmemory budgetvramwarm-upcompileAsyncpipelinesframe budgetsoak testlive showsthree internalswebgpu

Near it in the frame