You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gui-shader-codegen generates GPU shader source code (GLSL and HLSL), handles
WebGL shader submission, and provides offline compilation wrappers for
glslc, fxc, and dxc. It also includes high-level assembly functions that
compose a complete shader from structured options.
Import
cg := import('gui-shader-codegen')
All symbols are also re-exported by gui-shader and through the GUI facade.
GLSL Helpers
Function
Description
glslVersion(ver?)
#version directive. Defaults to 300 es.
glslPrecision(prec?, type?)
Precision declaration. Defaults to mediump float.
glslStdUniforms()
Standard uniforms block: iTime, iResolution, iMouse, iFrame.
glslUniform(type, name)
Single uniform declaration.
glslUniforms(uniforms)
Multiple uniforms from a list of { type, name } dicts.