Skip to content

The modern GPU API for the web

Learn WebGPU from scratch

Clear lessons on adapters, shaders, and the render pipeline, with examples you can run in the browser.

WebGPU
Static triangle. Browsers with WebGPU draw this live.

Learning paths

Four sections, each with a place to start. The guides below follow the same order as the sidebar.

Guide order

Each chapter continues from the one before it, from the first adapter through compute shaders.

  1. Introduction What WebGPU can do, and whether this browser can run it.
  2. Fundamental objects Adapter, device, command encoder, and queue.
  3. WGSL basics Types, entry points, and data passed between stages.
  4. Render pipeline Shader modules, pipelines, and render passes.
  5. Buffers Upload vertices and indices with GPUBuffer.
  6. Bind groups Hand buffers, textures, and samplers to a shader.
  7. Uniform buffers Pass values that change every frame.
  8. Textures and samplers Upload pixels and sample them in the fragment shader.
  9. Depth buffer Resolve occlusion with a depth test.
  10. Compute shaders Write a storage texture and read a buffer back.

You can read every tutorial in any browser. The live examples need a browser with WebGPU.

Runnable examples