TinyWebGPU
One file, no dependencies, no build step. Live demos below — each is a single self-contained HTML file. The picker in the corner switches every demo between the readable source, the minified build and the tiny build — the tiny one drops optional features, so demos that need them will say so.
Start here · The tutorial Sixteen steps from one coloured pixel to a particle system, with a live, editable code box at every stage. Runs on your GPU as you read.
WebGPU isn’t available in this browser. The demos need Chrome/Edge 113+,
Firefox 141+ (Windows), or Safari 26+, over https or localhost. On Android that means
Chrome 121+ on Android 12+ — Samsung Internet, Firefox for Android and the in-app browsers
inside chat and mail apps have no WebGPU at all.
Run the WebGPU check to see what this device reports.
Examples
- 1 · Hello fullscreen shader An animated fragment shader in about ten lines.
- 2 · Compute → storage buffer → readback A compute pass with no canvas at all, reading results back to JS.
- 3 · Ping-pong compute + present Game of life: two buffers swapped each frame, stepped and drawn in one submit.
- 4 · Indirect dispatch with GPU-side counters A kernel compacts work and counts it atomically; the next dispatch sizes itself from that count, with no CPU round-trip.
- 5 · Textures and blending Pixels uploaded from raw bytes and from an image source, sampled in a shader, with a translucent pass composited on top.
- 6 · Differential evolution A real black-box optimizer run population-parallel: one thread per individual, four textbook-hard objectives, and a 2D slice through a 32-dimensional search.
- 7 · Particle simulator Up to 800k particles pulled around by your pointer. No vertex buffers — each one splats into a density grid, and a fullscreen pass colours it.
-
8 · Flat-shaded height map
Your own vertex stage: a compute pass writes the terrain, and the vertex shader
reads it straight back out of the same buffer. 32k facets, no vertex buffers, and
depth: truefor the hiding.