finds.dev← search

// the find

evanw/lightgl.js

★ 1,571 · JavaScript · MIT · updated Aug 2022

A lightweight WebGL library

lightgl.js is a thin WebGL wrapper that deliberately stays low-level — no scene graph, just matrix stacks and immediate-mode helpers ported from classic OpenGL. It was built by Evan Wallace (the Figma co-founder) as a prototyping tool, and that lineage shows: the examples are technically impressive and the code is clean. It's for developers who know OpenGL concepts and want to skip the boilerplate without giving up control.

The OpenGL matrix stack emulation (gl.loadIdentity, gl.translate, gl.rotate) meaningfully reduces the ceremony of getting something on screen without hiding how WebGL actually works. The shader abstraction auto-reflects uniform and attribute locations from GLSL source, which eliminates a tedious category of bugs. The example set is unusually good for a library this size — shadow maps, CSG, GPU lightmaps, and a raytracer all in vanilla JS. Codebase is small enough to read in an afternoon: seven files, no build-time dependencies for usage.

Dead since 2022 and targeting WebGL 1 only — no WebGL2 support, no WebGPU path, and the GLSL built-ins it re-introduces (gl_Vertex, gl_ModelViewProjectionMatrix) are from GLSL ES 1.0, which modern browsers are beginning to deprecate in favor of stricter core profiles. The build system is a Python 2-era script that concatenates files; there's no npm package, no ES module export, no TypeScript types. For anything beyond a one-off prototype you'll quickly hit the ceiling on texture formats, instanced rendering, and compute — none of which are addressed. The last commit being three years ago means any bug you hit is yours to fix.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →