Skip to main content
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, unless timeEnabled is false), and mouse (normalized mouse position, unless mouseEnabled is false).
  • The Shader component is web-only. On iOS and Android, it will not render.
  • For best performance, keep shader complexity low and use updateInterval to throttle redraws when frame-perfect animation is not needed.

See Also

  • Rectangle — simple filled rectangle
  • Path — custom vector shapes