Back to shaders
Shader test bench
Glitch Scanline Bloom
runnable fragment
Complete GLSL fragment shader. Stronghold runs it directly when the browser can compile it.
Code
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(float n){return fract(sin(n)*43758.5453);}
void main(){
vec2 uv=gl_FragCoord.xy/resolution.xy;
float row=floor(uv.y*90.0);
float shift=(hash(row+floor(time*12.0))*2.0-1.0)*0.035*step(0.86,hash(row));
vec2 p=uv+vec2(shift,0.0);
float bars=sin(p.x*24.0+time*2.0)+sin(p.y*19.0-time*1.5);
float scan=0.72+0.28*sin(uv.y*resolution.y*3.14159);
vec3 col=0.5+0.5*cos(bars+vec3(0.0,2.0,4.0)+time);
float mask=smoothstep(0.65,1.0,abs(sin(p.x*8.0))*abs(cos(p.y*7.0)));
gl_FragColor=vec4(col*mask*scan,1.0);
}