runnable fragment

Aurora Veil

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1,311.7))) * 43758.5453123); }
float noise(vec2 p){ vec2 i=floor(p), f=fract(p); f=f*f*(3.0-2.0*f); return mix(mix(hash(i),hash(i+vec2(1.0,0.0)),f.x),mix(hash(i+vec2(0.0,1.0)),hash(i+vec2(1.0,1.0)),f.x),f.y); }
float fbm(vec2 p){ float v=0.0,a=0.5; for(int i=0;i<5;i++){ v+=a*noise(p); p*=2.0; a*=0.5; } return v; }
void main(){
  vec2 uv=gl_FragCoord.xy/resolution.xy;
  float band=0.0;
  for(int i=0;i<4;i++){
    float fi=float(i);
    float y=0.34+0.12*sin(uv.x*5.0+time*(0.35+fi*0.08)+fi);
    float n=fbm(vec2(uv.x*3.0+time*0.06, uv.y*2.0+fi));
    band += smoothstep(0.25,0.0,abs(uv.y-y-n*0.18))*0.35;
runnable fragment

Cellular Slime Mold

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){return fract(sin(dot(p,vec2(127.1,311.7)))*43758.5453);} 
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy; uv.x*=resolution.x/resolution.y; vec2 g=uv*11.0,id=floor(g),f=fract(g); float acc=0.0;
 for(int y=-1;y<=1;y++)for(int x=-1;x<=1;x++){vec2 o=vec2(float(x),float(y));float r=hash(id+o);vec2 c=o+0.5+0.35*vec2(sin(time*.5+r*6.28),cos(time*.4+r*9.1))-f;float d=length(c);acc+=0.018/(0.012+d*d);} 
 float vein=smoothstep(0.55,1.2,acc); vec3 col=mix(vec3(0.015,0.025,0.012),vec3(0.55,0.95,0.18),vein); col+=pow(acc,2.0)*0.03; gl_FragColor=vec4(col,1.0);
}
runnable fragment

Glitch Scanline Bloom

stronghold-curated generative glsl runnable fragment MIT
code snippet
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);
runnable fragment

Holographic Grid Tunnel

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
void main(){
 vec2 uv=(gl_FragCoord.xy*2.0-resolution.xy)/min(resolution.x,resolution.y);
 float z=1.0/(abs(uv.y)+0.18);
 float x=uv.x*z;
 float y=z+time*1.2;
 float gx=1.0-smoothstep(0.0,0.035,abs(fract(x)-0.5));
 float gy=1.0-smoothstep(0.0,0.035,abs(fract(y)-0.5));
 float horizon=smoothstep(0.0,0.7,z/8.0);
 vec3 col=vec3(0.0,0.02,0.06)+(gx+gy)*horizon*vec3(0.1,0.85,1.0);
 col+=pow(max(0.0,1.0-length(uv)),3.0)*vec3(0.6,0.1,1.0);
 gl_FragColor=vec4(col,1.0);
runnable fragment

Ink Diffusion Bloom

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){return fract(sin(dot(p,vec2(77.7,33.3)))*43758.5453);} 
float noise(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(hash(i),hash(i+vec2(1,0)),f.x),mix(hash(i+vec2(0,1)),hash(i+1.0),f.x),f.y);} 
float fbm(vec2 p){float v=0.0,a=0.5;for(int i=0;i<6;i++){v+=a*noise(p);p*=2.02;a*=0.52;}return v;}
void main(){
 vec2 uv=(gl_FragCoord.xy-0.5*resolution.xy)/min(resolution.x,resolution.y);
 float n=fbm(uv*3.0+vec2(time*0.04,-time*0.03));
 float rings=sin((length(uv)+n*0.28-time*0.04)*32.0);
 float ink=smoothstep(0.2,0.95,n+0.25*rings);
 vec3 paper=vec3(0.92,0.86,0.74);
 vec3 dye=mix(vec3(0.05,0.03,0.12),vec3(0.35,0.03,0.24),n);
 gl_FragColor=vec4(mix(paper,dye,ink),1.0);
runnable fragment

Kaleidoscope Prism

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
void main(){
  vec2 uv=(gl_FragCoord.xy*2.0-resolution.xy)/min(resolution.x,resolution.y);
  float a=atan(uv.y,uv.x);
  float r=length(uv);
  float seg=3.14159/6.0;
  a=abs(mod(a+time*0.12,seg*2.0)-seg);
  vec2 p=vec2(cos(a),sin(a))*r;
  float v=sin(18.0*p.x+time)+sin(16.0*p.y-time*1.3)+sin(12.0*(p.x+p.y)+time*0.7);
  vec3 col=0.55+0.45*cos(vec3(0.0,2.1,4.2)+v+r*8.0+time*0.2);
  gl_FragColor=vec4(col*(1.0-smoothstep(0.85,1.25,r)),1.0);
}
runnable fragment

Moire Pulse Rings

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
void main() {
  vec2 uv = (gl_FragCoord.xy - 0.5 * resolution.xy) / min(resolution.x, resolution.y);
  vec2 a = uv + 0.18 * vec2(sin(time * 0.5), cos(time * 0.4));
  vec2 b = uv - 0.16 * vec2(cos(time * 0.35), sin(time * 0.55));
  float r1 = sin(length(a) * 72.0 - time * 3.0);
  float r2 = sin(length(b) * 69.0 + time * 2.4);
  float m = smoothstep(0.0, 0.08, abs(r1 - r2));
  vec3 color = mix(vec3(0.98,0.2,0.55), vec3(0.1,0.9,1.0), m);
  color *= 0.55 + 0.45 * sin(length(uv) * 8.0 - time);
  gl_FragColor = vec4(color, 1.0);
}
runnable fragment

Nebula Dust Cloud

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){return fract(sin(dot(p,vec2(31.7,91.1)))*43758.5453);} 
float noise(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(hash(i),hash(i+vec2(1,0)),f.x),mix(hash(i+vec2(0,1)),hash(i+1.0),f.x),f.y);} 
float fbm(vec2 p){float v=0.0,a=0.5;for(int i=0;i<6;i++){v+=a*noise(p);p*=2.03+0.05*sin(time);a*=0.52;}return v;}
void main(){
 vec2 uv=(gl_FragCoord.xy-0.5*resolution.xy)/min(resolution.x,resolution.y);
 float n=fbm(uv*2.2+vec2(time*0.025,-time*0.015));
 float d=smoothstep(0.78,0.2,length(uv));
 vec3 col=mix(vec3(0.03,0.02,0.08), vec3(0.85,0.18,0.65), n);
 col=mix(col, vec3(0.12,0.55,1.0), smoothstep(0.45,0.85,fbm(uv*4.0-time*0.02)));
 gl_FragColor=vec4(col*n*d,1.0);
}
runnable fragment

Polar Flower Mandala

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
void main(){
 vec2 uv=(gl_FragCoord.xy*2.0-resolution.xy)/min(resolution.x,resolution.y); float r=length(uv), a=atan(uv.y,uv.x);
 float petals=sin(a*10.0+time*0.6)*0.18+sin(a*17.0-time*.35)*0.08;
 float shape=smoothstep(0.018,0.0,abs(r-(0.38+petals+0.06*sin(r*24.0-time))));
 float fill=smoothstep(0.72+petals,0.08,r);
 vec3 col=0.5+0.5*cos(vec3(0.0,2.1,4.2)+a*3.0+r*9.0+time*.2);
 gl_FragColor=vec4((shape+fill*.55)*col,1.0);
}
runnable fragment

Procedural Starfield Drift

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){ return fract(sin(dot(p, vec2(127.1,311.7))) * 43758.5453); }
void main(){
 vec2 uv=(gl_FragCoord.xy-0.5*resolution.xy)/min(resolution.x,resolution.y);
 vec3 col=vec3(0.0);
 for(int layer=0; layer<4; layer++){
   float z=float(layer)+1.0;
   vec2 p=uv*z + vec2(0.0,time*(0.08+0.03*z));
   vec2 id=floor(p*18.0); vec2 f=fract(p*18.0)-0.5;
   float rnd=hash(id+z);
   float star=smoothstep(0.045*rnd,0.0,length(f));
   col += star * mix(vec3(0.45,0.7,1.0), vec3(1.0,0.85,0.55), rnd) / z;
runnable fragment

Reaction Rings Approximation

stronghold-curated generative glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
float hash(vec2 p){return fract(sin(dot(p,vec2(41.0,289.0)))*45758.5453);} 
float noise(vec2 p){vec2 i=floor(p),f=fract(p);f=f*f*(3.0-2.0*f);return mix(mix(hash(i),hash(i+vec2(1,0)),f.x),mix(hash(i+vec2(0,1)),hash(i+1.0),f.x),f.y);} 
float fbm(vec2 p){float v=0.0,a=0.55;for(int i=0;i<5;i++){v+=a*noise(p);p*=2.05;a*=0.52;}return v;}
void main(){
 vec2 uv=(gl_FragCoord.xy-0.5*resolution.xy)/min(resolution.x,resolution.y);
 float n=fbm(uv*3.4+vec2(time*0.035,-time*0.025));
 float v=sin((length(uv)+n*0.42)*48.0-time*1.2);
 float cells=smoothstep(0.18,0.82,v)*smoothstep(1.05,0.35,n);
 vec3 a=vec3(0.02,0.03,0.055), b=vec3(0.96,0.76,0.28), c=vec3(0.2,0.75,0.72);
 gl_FragColor=vec4(mix(a,mix(b,c,n),cells),1.0);
}