Slatesource
PrivacyTerms© 2026 Slatesource

Shader

Run a live GLSL fragment shader with Shadertoy-style uniforms and an optional image texture.

All chips

:SHADER

Runs a user-authored GLSL ES 1.00 fragment shader live on the page using Shadertoy-style uniforms (iResolution, iTime, iMouse, iChannel0). All lines become the shader source, written as a void mainImage(out vec4 fragColor, in vec2 fragCoord) entry point. Supports the showSource option to display the source on the chip.

Lines

fragmentSource

Options

showsource

Example

:SHADER
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = fragCoord / iResolution.xy;
  vec3 col = 0.5 + 0.5 * cos(iTime + uv.xyx + vec3(0.0, 2.0, 4.0));
  fragColor = vec4(col, 1.0);
}

:SHADER [showSource:true]
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
  vec2 uv = fragCoord / iResolution.xy;
  fragColor = texture2D(iChannel0, uv);
}