Feature Library

Slide transitions

0.28 GPU · <0.01 CPU ms
A still of the Slide transitions demo
Still
The live demo starts when it’s in view.Click, tap or press → for the next picture · scrub with Progress

Six ways from one picture to the next on WebGPU.

What it costs a frame

0.28 ms
<0.01 ms
GPU
0.28 ms
CPU, median
<0.01 ms
CPU, 95th pct
<0.01 ms
Draw calls
0
Weight
Light

Measured 11 November 2026 on 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Plays all six transitions back to back, one picture to the next, at the stage’s size: one full-screen pass each (the shatter adds 288 shard triangles over it), timed with its own timestamp queries. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
unknown GPU · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool0.28<0.01<0.01
apple · Apple A19 Proin a browser tab · 16 November 20266.15<0.010.02
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20260.33<0.01<0.01

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
NothingNo other packages

What it’s for

  1. Slide decks and presentations
  2. Image galleries and carousels
  3. Scene changes in games
  4. Onboarding steps
  5. Video and photo editors
  6. Title sequences

Pitfalls, in brief

  1. The pictures must be loaded when you hand them over: copyExternalImageToTexture copies what is there now (an image still loading copies nothing; await img.decode() first).
  2. It draws at the canvas’s own width and height: size the canvas (CSS size × devicePixelRatio) before drawing, or it draws at 300 × 150.
  3. Progress 0 is the first picture exactly and 1 the second exactly, so you can swap a DOM view for the canvas at either end without a jump.
  4. Pictures are cover-fitted to the canvas (cropped at the edges); pass fit: 'stretch' to keep them whole, or draw them at the canvas’s shape.
  5. Light over 1 clips to white: there is no bloom.
2 more in brief
  1. draw() and play() each stop a play in progress (its promise resolves false): chain plays with await, and check the result before moving on.
  2. Never more than one draw on the GPU at a time: a draw asked for meanwhile waits and only the latest is drawn, so scrubbing fast never queues frames up.
7 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From SpaciousPro. Fully custom code.

Mark Jarzynski & Marc Olano, Hash Functions for GPU Rendering (2020): Their pcg2d, on the float’s bits, replaces the original shader’s hash.

Inigo Quilez, 2D distance functions: The digits’ segments use his box distance (sdBox).

Robert Penner, easing equations: The cubic in, out and in-out eases are the well-known forms of his curves.

transitionswgslraw webgpuslideswipeshatterinstancingeasing

Near it in the frame