Skip to content

Quick start

The documentation is a work in progress, and the API of useGL is still subject to changes. For now, you can browse the examples to get an idea of how the library works.

A proper documentation will come soon !

Installation

pnpm add usegl

Usage

import { useWebGLCanvas } from "usegl";
useWebGLCanvas({
canvas: "#glCanvas",
fragment: /* glsl */ `
varying vec2 vUv; // automatically provided
uniform float uTime; // automatically provided and updated
void main() {
gl_FragColor = vec4(vUv, sin(uTime) / 2. + .5, 1.);
}
`,
});