Skip to content

Technologies

The same scenes, four ways.

Every page below covers the same two reference scenes: an animated cosine-palette plasma (three cosines a phase apart) and a lit, depth-tested, spinning cube. WebGL and WebGPU render them on the page; Three.js and vgpu print the code that would and say so, because neither is a dependency of this site. The maths never changes, so what you are comparing is purely the code you have to write around it — and the cube is the more honest half, because a full-screen effect exercises almost no plumbing.

colour = 0.5 + 0.5 · cos(time + uv.xyx + (0, 2, 4))

A cosine-palette plasma, running here in WebGL. Of the four pages below, WebGL and WebGPU render it on their own; Three.js and vgpu print the code that would and say plainly that nothing is running.

Which should you use?

There is no best one — there is a best one for a target. Answer three questions and see what falls out, along with the reasoning.

Its own page →
What are you making?
Who has to be able to run it?
How much do you want to write yourself?

This is a rule of thumb, not a verdict — the scoring is a few dozen lines you can read in lib/chooser.ts. The one hard rule is compute: WebGL has no compute stage, so no amount of preference makes it — or anything drawing through it — the answer there.

Side by side

WebGL

Browser API · GLSL

Plasma
25
Lit cube
~118
Demo
Runs here
WebGPU

Browser API · WGSL

Plasma
41
Lit cube
~149
Demo
Runs here, with WebGPU
Three.js

Library · scene graph

Plasma
18
Lit cube
24
Demo
Code only
vgpu

Library · WebGPU + WGSL

Plasma
12
Lit cube
19
Demo
Code only

Of these eight numbers, six are counted rather than asserted: each is the length of the listing printed on that page, by the same rule as the line count in the listing’s own header, so the figures here cannot disagree with the code underneath them. The two carrying a tilde — WebGL’s cube and WebGPU’s cube — are estimates of a complete implementation, because those listings are excerpts and there is nothing printed to count. Either way the figure is the plumbing around the shader, not a quality score: fewer lines means more is being done for you, which is exactly what you want in one situation and exactly what you do not want in another. Of the two scenes the cube is the more honest: the plasma has no geometry, no camera and no depth buffer, so it barely exercises the differences at all.

WebGL

Open →

Browser API · GLSL

The baseline. Everything on this site runs on it.

WebGPU

Open →

Browser API · WGSL

The successor. Stricter, far more capable, and finally shipping.

Three.js

Open →

Library · scene graph

A scene, not a pipeline. The default answer for most 3D on the web.

vgpu

Open →

Library · WebGPU + WGSL

A small typed layer over WebGPU that also runs headless.

Not sure which to learn first? Start with WebGL — not because it is the future, but because everything else here is a reaction to it, and the ideas transfer. The labs are almost all built on it — the two that cannot be are marked, and say why — and the reading path takes it from there.