Creative Coding

WebGPU made browser graphics feel serious

4 min read

Chrome 113 shipping WebGPU made browser graphics feel like a serious learning surface.

Before that, browser graphics often felt split between two worlds. Canvas was friendly but limited. WebGL was powerful but carried a lot of historical OpenGL texture. Native graphics APIs were serious but far away from the page where many visual ideas needed to live.

WebGPU changed the feel of that tradeoff.

the browser starts to look like a real graphics host

WebGPU does not make graphics easy. It makes the browser feel like a reasonable place to learn modern GPU-shaped thinking: adapters, devices, buffers, pipelines, shaders, command encoders, and explicit resource setup.

That matters because the browser is where a lot of people can actually share the experiment.

const adapter = await navigator.gpu.requestAdapter()
const device = await adapter?.requestDevice()

That small sequence teaches an important idea: the browser is mediating access to real hardware. The page asks for an adapter, then a device, then creates resources through that device.

setup is part of the lesson

WebGPU is easy to introduce through drawing to a canvas, but rendering is only part of the story.

const context = canvas.getContext("webgpu")
const format = navigator.gpu.getPreferredCanvasFormat()

context?.configure({
  device,
  format,
})

Then the program creates a render pipeline, records commands, and submits work to the queue.

That is already more explicit than many browser developers are used to. You do not draw a rectangle. You describe resources, bind them, encode work, and submit commands.

shaders become readable in the web stack

WebGPU uses WGSL for shaders, which makes the learning path feel tied to the platform instead of borrowed from a native graphics stack.

@vertex
fn vertexMain(@location(0) position: vec2f) -> @builtin(position) vec4f {
  return vec4f(position, 0.0, 1.0);
}

@fragment
fn fragmentMain() -> @location(0) vec4f {
  return vec4f(0.1, 0.4, 0.9, 1.0);
}

That snippet is tiny, but it teaches two useful concepts: vertex work produces positions, and fragment work produces color.

performance becomes inspectable

WebGPU also makes performance visible.

Pipeline creation, bind groups, buffer usage, texture formats, and command submission are concrete parts of the program. In a bigger system, that is useful because performance is no longer a vague complaint about “the browser being slow.”

I want to be able to ask:

  • are buffers recreated every frame?
  • is pipeline creation happening during interaction?
  • are large transfers crossing the CPU and GPU boundary?
  • are commands batched sensibly?
  • is the shader doing too much per fragment?

Those are real graphics questions. WebGPU brings them into ordinary web development instead of leaving them behind a native tooling wall.

portability is part of the deal

The browser does not erase hardware differences.

A WebGPU demo may run beautifully on a desktop GPU and struggle on an integrated laptop GPU. Limits differ. Feature support differs. Memory budgets differ. Thermal behavior differs. The browser adds validation and safety constraints that native code may not have in the same way.

That is not a reason to avoid WebGPU. It is part of what makes it useful to learn from. The web forces portability into the conversation early.

For product work, that means designing fallbacks:

if (!navigator.gpu) {
  renderStaticPreview()
} else {
  await renderWebGpuExperience()
}

The fallback is not a failure. It is the product admitting that graphics capability is part of the user’s environment.

the web gets a stronger compute surface

Creative coding benefits from short feedback loops. If I can write a shader, refresh the page, share a URL, and inspect the result with browser tools, I will try more ideas. Some of those ideas will be useless. That is fine. The cost of trying them is low.

WebGPU matters because it makes heavier experiments plausible in that loop: particle fields, procedural textures, signed distance field experiments, interactive diagrams, and visual explanations that would be painful in plain Canvas.

The browser also gives the experiment context. The visual can live beside prose, controls, source snippets, and state. That is useful for teaching. A shader toy is fun; a shader toy embedded in an explanation can become a real learning object.

WebGPU made browser graphics feel serious because it exposed serious concepts. That is the trade. The API asks for more explicit setup than the friendly parts of the web, and it gives the browser a much stronger graphics and compute surface in return.

Jeremy London

About Jeremy London

Engineering leader and builder in Denver. I write about AI platforms, agents, security, reliability, homelab infrastructure, and the parts of engineering work that have to survive production.