glsl-transpiler
JSON →Transforms GLSL shader source code into optimized JavaScript, converting vectors and matrices to arrays, expanding swizzles, and applying expression optimizations. The latest version (2.0.21) ships as an ESM package with optional CommonJS support. It works both as a programmatic API and as a stream transform, integrating with glsl-parser and glsl-tokenizer. Key differentiators include runtime variable replacement for uniforms/attributes/varyings, built-in stdlib for environment compatibility, debug facilities (print/show), and support for GLSL ES 100 and 300. Alternatives like glsl.js or raw string manipulation lack its AST-level optimization and streaming pipeline. The package is a fork of the original stackgl/glsl-transpiler with ongoing maintenance.
Traffic · last 30 days ↓67% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇧🇷 Brazil · 🇸🇬 Singapore