The live demo starts when it’s in view.Click the water to ripple it · right-click anywhere for the menu
Glass slabs over live water, drawn by WebGPU (or its WebGL2 twin) behind ordinary DOM.
What it costs a frame
GPU
3.10 ms
CPU
0.16 ms
02468101216.7 ms
GPU
3.10 ms
CPU, median
0.16 ms
CPU, 95th pct
0.25 ms
Draw calls
0
Weight
Heavy
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: Measured with the water moving under five glass panels and three chips: two full-screen passes (water and glass, then the menu blob), timed with their own timestamp queries. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
6.88
0.30
0.38
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
1.64
0.33
0.55
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.
How steadily it runs on Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258V · in a browser tab
Typical frame ?
16.65 ms
1% low ?
55 fps
Varies by ?
±0.41 ms
All metricsIntel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258V · in a browser tabHow long each frame took. Most frames sit in the tall bars; a long tail to the right is hitching.
Frames run on a 60 Hz timer (a page demo), so most frames take about one tick, 16.7 ms: the spread around it is what matters.
Frames
Median (p50) ?
16.65 ms
p95 ?
17.38 ms
p99 ?
17.77 ms
Slowest ?
19.73 ms
Mean ?
16.69 ms
Standard deviation ?
0.41 ms
1% low ?
55 fps
0.1% low ?
51 fps
Hitches ?
0 of 600
Over budget ?
0 of 600
Main thread
Long tasks ?
0
Long frames ?
0
Event-loop delay ?
0.1 / 0.7 / 0.8 ms
Input
No input during this run. A browser-tab run plays none.
Memory
JavaScript heap ?
76.8 → 68.4 MB
Growth ?
-8.45 MB
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
NothingNo other packages
What it’s for
Dashboards and control panels
Hero sections
Context menus and popovers
Settings and onboarding screens
Game menus
HUD panels over a 3D scene
Text over a picture or map
Pitfalls, in brief
Give marked elements a transparent background: the GPU draws their glass under them.
Each frame reads every marked element’s rect (getBoundingClientRect): keep the count to the 32 the frame uniform holds, minus the ripples and the theme.
A corner radius is read from CSS once per element and cached: change an element’s radius and it keeps the old one.
The canvases are premultiplied alpha: a shader must return rgb × a.
On a weak GPU pass tier (GLASS_TIER): low draws at most 1 pixel per CSS px and medium 1.5, where high draws 2; both skip the over pass (the menu blob, a second full-screen pass and canvas) while no menu or drop shows, clearing it once when they go.
6 more in brief
Never queue more than one frame ahead: frame() skips while the last one is still on the GPU.
The pipelines compile in the background (createRenderPipelineAsync): the glass appears a moment after the page, never freezing it.
Without WebGPU, createLiquidGlass draws the same glass with WebGL2 by itself (two canvases, a WebGL2 context each; webgl: false turns it off, and it returns null without WebGL2 too: style the panels so they still read).
Over a scene, the glass pass is the last thing drawn: draw the scene into a texture with TEXTURE_BINDING usage (not the canvas) and give the canvas to encode() as the target.
Over a scene, setPanels() takes the pixel ratio of the picture to the host (device px over CSS px): pass the one you sized the picture with, or the rects and the pointer land in the wrong place.
Hover and alert light only tint the rim and a thin band inside it: they are not a state on their own.
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.
Inigo Quilez, 2D distance functions and smooth minimum: sdRoundBox (every panel’s shape) and the polynomial smin (the menu blob and toasts melting together) follow his published formulas, re-written in WGSL.
Apple, Liquid Glass (2025): The look this answers: a design inspiration, no code.
Kenny Mitchell, Volumetric Light Scattering as a Post-Process (GPU Gems 3, 2007): The demo’s sun shafts over a scene: a radial gather toward the light, here at a quarter of the size and masked by the panels.
Mark Jarzynski and Marc Olano, Hash Functions for GPU Rendering (2020): The PCG hash behind the demo scene’s stars and the shafts’ jitter.
One event, felt everywhere: impact({ x, y, mass }) makes every [data-body] element dip, rock and ring down on its shock mounts by its distance and its own…
One distance-field atlas holds a thin and a black cut of a typeface in its red and green channels, every glyph in the same fixed cell, so mixing the channels…