Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Renders multiple triangles with different colors.
# webgpu/demo/multi_triangles.js
async function drawMultiple() {
const canvas = document.getElementById('canvas');
const adapter = await navigator.gpu.requestAdapter();
const device = await adapter.requestDevice();
const context = canvas.getContext('webgpu');
// Setup multiple vertex buffers for triangles and render
}
drawMultiple();WebGPU is a modern, low-level graphics and compute API for the web that provides high-performance access to GPU hardware. It is the successor to WebGL, offering better performance, compute shaders, modern GPU features, and a more efficient programming model inspired by Vulkan, Metal, and Direct3D 12.
Origin & Creator
WebGPU was designed by the W3C GPU for the Web Community Group, with major contributions from Google, Mozilla, Apple, Intel, and the broader WebAssembly/WebGL community (2017-2024).
Industrial Note
WebGPU is rapidly being adopted for in-browser AI inference, game engines, CAD tools, simulation platforms, ML model runners, and high-performance web visualizations. It enables workloads previously only possible natively.