shader
shader(
o):ShaderFilter
A custom fragment shader as a filter: WebGL only. On Canvas 2D it is skipped (the node is drawn without it, engine.stats.filtersSkipped counts it, the console says so once): check engine.supports.shaders and pick another look there. Compiled once per distinct source. With a WebGL engine running, a shader that does not compile throws here with the compiler’s log; otherwise the error is logged once at its first use and the filter skipped.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Example
Section titled “Example”const wave = shader({ fragment: `uniform float uAmp; void main() { gl_FragColor = texture2D(uTexture, vUv + vec2(sin(vUv.y * 40.0 + uTime * 4.0) * uAmp, 0.0)); }`, uniforms: { uAmp: 0.004 }, padding: 8,})flag.filters = [wave]