Glitch
glint · Examples · Tutorials · Gallery
A post-processing chain over a neon scene: datamosh-style block feedback, RGB split, displaced slices, scanlines and VHS noise, all triggered by the music.
Audio-reactive: it moves with music from a microphone, line-in or a file.

An example in glint, a free live shader editor in the browser: the GLSL code floats over the running picture and recompiles as you type.
The code
2 passes, drawn in this order each frame, in GLSL.
Scene: fragment shader
#version 300 es
precision highp float;
uniform float time;
uniform vec2 resolution;
uniform vec2 mouse;
uniform vec3 spectrum;
uniform vec3 spectrumIntegrated;
uniform float beat;
in vec2 v_texcoord;
out vec4 fragColor;
float sdBox(vec2 p, vec2 b) { vec2 d = abs(p) - b; return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0); }
void main() {
vec2 uv = (gl_FragCoord.xy - 0.5 * resolution) / resolution.y;
vec3 col = vec3(0.02, 0.0, 0.05);
// A pulsing grid of rotated neon squares and a horizon.
for (int i = 0; i < 5; i++) {
float fi = float(i);
vec2 p = uv * (1.0 + fi * 0.6);
p = mat2(cos(time * 0.2 + fi), -sin(time * 0.2 + fi), sin(time * 0.2 + fi), cos(time * 0.2 + fi)) * p;
float d = abs(sdBox(p, vec2(0.3 + 0.1 * sin(time + fi) + spectrum.x * 0.2)));
col += (0.5 + 0.5 * cos(6.2831 * (fi * 0.2 + vec3(0.0, 0.33, 0.67) + time * 0.05))) * 0.004 / (d * d + 0.002) * 0.3;
}
col += vec3(0.9, 0.2, 0.8) * smoothstep(0.01, 0.0, abs(uv.y + 0.3)) * 0.8;
fragColor = vec4(col, 1.0);
}Glitch: fragment shader
#version 300 es
precision highp float;
uniform sampler2D prevPass;
uniform sampler2D feedback;
uniform vec2 resolution;
uniform float time;
uniform int frame;
uniform vec3 spectrum;
uniform float beat;
uniform int beatCount;
uniform float amount;
in vec2 v_texcoord;
out vec4 fragColor;
float hash(vec2 p) { return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
void main() {
vec2 uv = v_texcoord;
float g = amount * (0.2 + beat + spectrum.z * 0.8);
float seed = float(beatCount) + floor(time * 8.0) * 0.1;
// Displace horizontal slices.
float slice = floor(uv.y * 24.0);
if (hash(vec2(slice, seed)) < g * 0.3) uv.x += (hash(vec2(slice, seed + 1.0)) - 0.5) * 0.2 * g;
// Datamosh: some 32px blocks keep last frame's pixels, dragged slightly.
vec2 block = floor(gl_FragCoord.xy / 32.0);
bool mosh = hash(block + seed) < g * 0.25;
// RGB split.
float s = 0.004 * g + 0.001;
vec3 col = vec3(texture(prevPass, uv + vec2(s, 0.0)).r, texture(prevPass, uv).g, texture(prevPass, uv - vec2(s, 0.0)).b);
if (mosh) col = texture(feedback, uv + vec2(0.003, -0.002)).rgb;
// Scanlines, noise and a rolling VHS band.
col *= 0.85 + 0.15 * sin(gl_FragCoord.y * 3.1416);
col += (hash(gl_FragCoord.xy + time) - 0.5) * 0.06;
col += smoothstep(0.02, 0.0, abs(fract(uv.y * 0.5 - time * 0.1) - 0.5)) * 0.08;
fragColor = vec4(col, 1.0);
}More Showpieces examples
Fluid · GPU particles · Physarum · SmoothLife · Quaternion Julia · Aurora · Caustics · Glass orbs