object
Configuration options for the shader.
The web renderer compiles
fragmentShader as a plain GLSL fragment shader: write void main(), read gl_FragCoord and the time, resolution and mouse uniforms, and write to gl_FragColor. A Shadertoy-style mainImage body fails to compile with Missing main() and renders a blank canvas.Support
Usage
Solid color shader
Gradient shader
Animated shader
With custom uniforms
Interactive shader
Notes
- Shaders use WebGL. Built-in uniforms are
resolution(canvas size in device pixels),time(seconds since start, unlesstimeEnabledisfalse), andmouse(normalized mouse position, unlessmouseEnabledisfalse). - The Shader component is web-only. On iOS and Android, it will not render.
- For best performance, keep shader complexity low and use
updateIntervalto throttle redraws when frame-perfect animation is not needed.