Registry / ai-ml / wonder-glsl-compiler

wonder-glsl-compiler

JSON →
library0.1.17jsnpmunverified

A GLSL compiler library for transforming GLSL shaders at runtime. Version 0.1.17 is the latest stable release with irregular updates. It provides shader compilation and optimization for WebGL/WebGPU applications. Differentiates by offering a lightweight, pure JavaScript implementation without external GPU dependencies, suitable for shader preprocessing in build tools or runtime environments.

npm install wonder-glsl-compiler
INSTALL
IMPORT
SIG · WONDER-GLSL-COMPIL
W
wonder-glsl-compiler
ai-mljavascriptv0.1.17
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wonderGLSLCompiler
import wonderGLSLCompiler from 'wonder-glsl-compiler'
Default import is the main entry point for the compiler.
compile
import { compile } from 'wonder-glsl-compiler'
Named export available for tree-shaking.
Types
import type { CompileOptions } from 'wonder-glsl-compiler'
TypeScript type imports for compile options.

Demonstrates basic usage of the compiler: import, compile a simple GLSL shader, and log the output.

import wonderGLSLCompiler from 'wonder-glsl-compiler'; const glslCode = 'void main() { gl_FragColor = vec4(1.0); }'; const result = wonderGLSLCompiler.compile(glslCode); console.log(result.output);
Debug
Known issues
gotchaThe library does not validate GLSL syntax; invalid shaders may cause runtime errors.
fix
Pre-validate shaders using a GLSL linter before compilation.
affects: <=0.1.17
deprecatedOlder versions may rely on deprecated APIs removed in Node.js 18+.
fix
Upgrade to 0.1.17 or later.
affects: <0.1.17
gotchaOnly supports immediate mode compilation; no caching or incremental rebuilds.
fix
Implement manual caching if compiling multiple shaders.
affects: <=0.1.17
Errors
Common errors & fixes
TypeError: wonderGLSLCompiler.compile is not a function
Importing default as named function incorrectly.
fix
Use default import: import wonderGLSLCompiler from 'wonder-glsl-compiler';
Cannot find module 'wonder-glsl-compiler'
Package not installed or incorrect import path in TypeScript.
fix
Run npm install wonder-glsl-compiler and ensure tsconfig.json resolves modules.
Error: GLSL compilation failed with errors
GLSL shader code has syntax or semantics errors.
fix
Check the shader code for typos or unsupported features.
Upgrade
Version history
0.1.17latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
43 hits · last 30 days
node
36
OpenAI (training)
1
Resources
wonder-glsl-compiler — npm install wonder-glsl-compiler · libregistry