After WebGL, A New Era
WebGL enabled the web to do 3D. It was revolutionary in 2011. But WebGL is built on OpenGL ES, an API designed in the 90s. Thirteen years later, GPUs have radically evolved, and WebGL shows its limits.
WebGPU arrives to bridge this gap. Inspired by Vulkan, Metal, and DirectX 12, it's a modern API that exposes the real capabilities of contemporary GPUs. And after using it on a real project, the verdict is clear: it changes everything.
What WebGPU Actually Brings
1. Compute Shaders in the Browser
This is perhaps the most significant change. WebGL only allowed graphics rendering. WebGPU enables general-purpose GPU computing (GPGPU).
Concretely? You can now run machine learning, physics simulations, image processing, directly on the client's GPU. No plugin, no hastily compiled WASM.
The implications are massive for web applications requiring computing power: photo editing, video editing, complex data visualization, local AI.
2. An Explicit Memory Model
WebGL managed GPU memory opaquely. You sent data, OpenGL decided what to do with it. Simple but inefficient.
WebGPU exposes an explicit memory model. You create buffers, manage their lifecycle, control CPU-GPU transfers. More work, but predictable and optimizable performance.
For developers coming from Vulkan or Metal, it's familiar. For WebGL developers, it's a learning curve.
3. Pipeline State Objects
In WebGL, changing a render parameter (blend mode, depth test, shader) was an individual operation. The driver had to recompile states on each change.
WebGPU introduces Pipeline State Objects: you define a complete configuration in advance, the GPU compiles it once, then you use it directly. The result: less stuttering, more consistent performance.
4. Better Multi-threading
WebGL was fundamentally single-threaded. WebGPU allows preparing commands in Web Workers, then submitting them to the GPU from the main thread.
For complex applications, this unlocks architectures impossible in WebGL: background scene preparation, resource streaming without blocking rendering.
The Benchmarks Speak
On comparable test scenes, WebGPU shows 2x to 10x gains depending on use case. The most spectacular gains involve scenes with many draw calls: where WebGL collapses at a few thousand objects, WebGPU maintains stable framerates at tens of thousands.
Compute shaders show near-native performance for parallelizable tasks. On image convolution, a test shows WebGPU at 85% of native Metal performance. Remarkable for code running in a browser.
Real Adoption
All major browsers now support WebGPU: Chrome since 2023, Firefox in preview, Safari in active development. Support isn't yet universal (some older GPUs are excluded), but coverage grows rapidly.
Web 3D frameworks are migrating. Three.js has an experimental WebGPU renderer. Babylon.js supports WebGPU in production. PlayCanvas, Cocos, Unity WebGL are looking at WebGPU seriously.
The problem: fragmentation during transition. For a few years, developers will need to maintain WebGL fallbacks for unsupported environments.
What This Changes For Developers
For web gaming: WebGPU unlocks graphic quality levels impossible in WebGL. Techniques like ray tracing, screen-space ambient occlusion, massive particle effects become viable.
For creative applications: Figma, Photopea, online video editing tools can now offer near-native performance. "It's limited because it's web" becomes less and less true.
For local AI: ML models can run on the client's GPU. Vision model inference, language processing, all without sending data to a server. Huge implications for privacy.
For data visualization: Datasets of millions of points become manipulable in real-time in the browser.
Remaining Challenges
The API is more complex than WebGL. The "hello triangle" in WebGPU requires significantly more code than its WebGL equivalent. The learning curve is real.
Debugging remains primitive. Tools like RenderDoc support WebGPU, but the experience isn't as polished as for native APIs.
Perfect portability is a myth. Differences between backends (Vulkan vs Metal vs D3D12) sometimes leak into observed behaviors. Bugs can be specific to certain GPU/OS/browser combinations.
And mobile support lags behind. iOS Safari advances slowly, Android varies by manufacturer.
Perspective: The Web Becomes a Real Platform
WebGPU fits into a broader trend: the web is becoming capable of everything native apps did better.
WASM for CPU compute. WebGPU for GPU. WebCodecs for audio/video. File System Access for local files. Each year, another gap closes.
The "native or web" question becomes less clear-cut. For many applications, the web now offers comparable performance with infinitely simpler distribution.
Conclusion
WebGPU isn't just a WebGL update. It's a fundamental rethink of what the browser can do with the GPU. For developers working on graphically intensive applications, now is the time to invest in this technology.
The transition will take years. Universal support isn't here yet. But the direction is clear: the web is catching up graphically to native, and WebGPU is the vehicle for this catch-up.
If you do web graphics, learn WebGPU now. In five years, it'll be the baseline, and WebGL will be the legacy we reluctantly maintain.
