greggman/twgl.js

A Tiny WebGL helper Library

View on GitHub ↗Jump to charts ↓

greggman/twgl.js has 3k+ stars and 250+ forks on GitHub, is written in JavaScript, and was last pushed on Sep 9, 2026. Data as of . Signed-in members get hourly updates — create a free account.

Summary Information

Updated 41 minutes ago
Added to GitGenius on September 23rd, 2026
Created on March 27th, 2015
Open Issues & Pull Requests: 55 (+0)
GitHub issues: Enabled
Number of forks: 264
Total Stargazers: 3,023 (+0)
Total Subscribers: 56 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.5 hours
Mean response time: 6.8 hours
90th percentile: 14.4 hours
Tracked items: 5

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 4
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 681 days
Stale 30+ days: 4
Stale 90+ days: 4

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

Sign in to see which issues are moving.
Sign in

Detailed Description

TWGL is a lightweight JavaScript library that reduces the verbosity of the WebGL API.

WebGL requires extensive boilerplate code to accomplish basic tasks like compiling shaders, creating buffers, setting attributes, and managing uniforms. A simple lit cube in raw WebGL might require over sixty function calls. TWGL addresses this by wrapping the most common WebGL operations into a small set of helper functions. The core functionality centers on six main functions: createProgramInfo for shader compilation and setter generation, createBufferInfoFromArrays for buffer creation, setBuffersAndAttributes for binding, setUniforms for uniform assignment, createTextures for texture setup, and createFramebufferInfo for framebuffer creation. These helpers eliminate repetitive setup code while maintaining direct access to the underlying WebGL API.

TWGL suits developers who want to work directly with WebGL rather than adopting a full 3D framework. The README explicitly positions it as an alternative to three.js, recommending TWGL for those doing low-level WebGL work who want less verbosity without the abstraction overhead of a complete engine. It handles shader compilation, buffer management, texture creation, framebuffer setup, and uniform structures including arrays of GLSL structures. The library works with both WebGL and WebGL2, supporting features like vertex array objects and instancing.

The project maintains a focused scope with a small set of core functions and additional lower-level utilities for specialized needs. Development activity shows consistent engagement with examples covering diverse use cases including particles, text rendering, skyboxes, and dynamic buffers. The codebase remains actively maintained with responsiveness to issues and pull requests. The project demonstrates stability through its established documentation and comprehensive example collection spanning basic geometry through advanced techniques like GPGPU particle systems.