Journal
Oct 29, 2026·3 min read· WebGL

WebGPU: what changes for a WebGL developer

I have written WebGL for years, mostly through three.js. Reading and experimenting with WebGPU, the API differences matter less than the change in how you think.

State machine versus descriptions

WebGL is one big state machine: bind this, enable that, draw, and hope nothing you set earlier leaks in. WebGPU asks you to describe things up front: a pipeline says which shaders, which vertex layout, which blend mode. Drawing is then "use this pipeline with these buffers". More typing at the start, far fewer mystery bugs later.

Shaders are a different language

WebGPU uses WGSL instead of GLSL. The ideas carry over; the syntax does not. Expect to rewrite, not port.

Compute shaders

This is the reason to care. In WebGL, running a simulation on the GPU means dressing it up as rendering: store positions in a texture, draw a full-screen quad, read the result back as a texture. WebGPU has compute shaders that simply run code over buffers. Particles, fluids and physics become direct instead of a trick.

Everything is asynchronous

Requesting an adapter and a device, creating pipelines, reading data back: all promises. Code that assumed "context ready on the next line" needs restructuring.

Should you switch?

For most sites, not by hand. three.js has a WebGPU renderer and a node-based material system that targets both backends, and that is the sensible route for production work today. Check current browser support before you rely on it, and keep a WebGL path for visitors who do not have it yet.

If you are learning, write one triangle and one compute pass by hand. An afternoon of that explains more than a week of reading.