Build interactive 3D data visualizations that run in the browser using GPU acceleration via WebGL.
Create particle systems or custom shader effects without managing raw WebGL state manually.
Write a browser-based game or animation loop with high-performance GPU-accelerated rendering.
Install via npm or a script tag, no build tools or external services required.
Regl is a JavaScript library for writing graphics programs that run in the browser using WebGL. WebGL is the browser's interface to the GPU, which lets you draw 2D and 3D visuals at high speed. Working with raw WebGL involves tracking a lot of global state that changes from one drawing operation to the next, which makes code difficult to follow and easy to break. Regl addresses this by replacing that global state model with two simpler concepts: resources and commands. A resource is a reference to something stored on the GPU, like a texture image or a buffer of vertex positions. A command is a complete, self-contained description of a single drawing operation, including the shader code, the geometry data, and any per-call parameters. You define a command once, and then call it each frame with whatever changing inputs it needs. Because each command is a plain JavaScript object, regl can compile it into optimized code before any drawing happens. This means you write declarative, readable code without giving up runtime performance. The library also runs validation checks in development mode to catch mistakes early, and strips those checks out when you build for production. Regl has no dependencies, so adding it to a project is straightforward via npm or a script tag. It does not include a scene graph, a math library, or any game-engine features. The design is deliberately narrow: it wraps WebGL closely and exposes all WebGL capabilities, including extensions like instanced rendering and multiple render targets, without abstracting them away. The project has over 30,000 unit tests, above 95% code coverage, and runs continuous benchmarks to catch performance regressions. It follows semantic versioning for long-term API stability.
← regl-project on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.