the current renderer instance
GLSL code containing a vec4 apply(vec4 color, vec2 uv) function
that receives the sampled pixel color and UV coordinates, and returns the modified color.
You can declare additional uniform variables before the apply() function.
Optionalprecision: stringfloat precision ('lowp', 'mediump' or 'highp')
Readonlydestroyedtrue once destroy has been called. Distinct from
enabled — which also toggles transiently across a context
lost / restored cycle — to give callers a stable signal for
"this effect has been explicitly released."
whether this effect is active (false in Canvas mode, false after
destroy, and false while the WebGL context is suspended
between an ONCONTEXT_LOST and the matching ONCONTEXT_RESTORED
event).
destroy this shader effect. Idempotent — calling destroy twice is safe. Unsubscribes from the renderer's context-lost / restored events so a destroyed effect is not auto-reactivated.
Set the uniform to the given value
the uniform name
the value to assign to that uniform
A simplified shader class for applying custom fragment effects to renderables. Only requires a fragment
apply()function — the vertex shader, uniforms, and texture sampling boilerplate are handled automatically. In Canvas mode, the shader is silently disabled (all methods become no-ops).Example
Example