runnable fragment

Cyber Circuit Traces

stronghold-curated pattern 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(17.0,59.4)))*43758.5453);} 
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy; uv.x*=resolution.x/resolution.y;
 vec2 g=uv*12.0; vec2 id=floor(g); vec2 f=fract(g);
 float rnd=hash(id);
 float h=smoothstep(0.47,0.49,abs(f.y-0.5))*smoothstep(0.51,0.49,abs(f.y-0.5));
 float v=smoothstep(0.47,0.49,abs(f.x-0.5))*smoothstep(0.51,0.49,abs(f.x-0.5));
 float active=step(0.45, sin(rnd*6.283+time*1.5));
 float pads=smoothstep(0.18,0.0,length(f-0.5))*step(0.72,rnd);
 float glow=(h*step(0.35,rnd)+v*step(rnd,0.65)+pads)*active;
 gl_FragColor=vec4(vec3(0.01,0.025,0.04)+glow*vec3(0.0,0.95,0.75),1.0);
runnable fragment

Electric Voronoi Cells

stronghold-curated pattern glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
vec2 hash(vec2 p) { p = vec2(dot(p, vec2(127.1,311.7)), dot(p, vec2(269.5,183.3))); return fract(sin(p) * 43758.5453); }
void main() {
  vec2 uv = gl_FragCoord.xy / resolution.xy;
  uv.x *= resolution.x / resolution.y;
  vec2 g = uv * 7.0;
  vec2 id = floor(g);
  vec2 f = fract(g);
  float d1 = 9.0;
  float d2 = 9.0;
  for (int y=-1; y<=1; y++) for (int x=-1; x<=1; x++) {
    vec2 o = vec2(float(x), float(y));
runnable fragment

Neon Wave Weave

stronghold-curated pattern glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy; uv.x*=resolution.x/resolution.y;
 float a=sin((uv.x*18.0 + sin(uv.y*9.0+time)*2.0) - time*1.4);
 float b=sin((uv.y*22.0 + cos(uv.x*8.0-time)*2.0) + time*1.1);
 float lines=smoothstep(0.82,1.0,abs(a))*0.7 + smoothstep(0.86,1.0,abs(b))*0.7;
 vec3 bg=vec3(0.015,0.02,0.07);
 vec3 c=mix(vec3(1.0,0.12,0.6), vec3(0.1,0.9,1.0), step(a,b));
 gl_FragColor=vec4(bg + c*lines,1.0);
}
runnable fragment

Op Art Checker Warp

stronghold-curated pattern 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); float a=atan(uv.y,uv.x);
 vec2 p=uv + 0.18*sin(vec2(uv.y,uv.x)*8.0+time) + 0.08*vec2(cos(a*6.0+time),sin(a*5.0-time));
 float c=mod(floor(p.x*9.0)+floor(p.y*9.0),2.0);
 float rings=0.5+0.5*sin(r*28.0-time*1.2);
 vec3 col=mix(vec3(0.02),vec3(0.96),c); col=mix(col,col.bgr,rings*.35);
 gl_FragColor=vec4(col,1.0);
}
runnable fragment

Stained Glass Mosaic

stronghold-curated pattern glsl runnable fragment MIT
code snippet
precision mediump float;
uniform vec2 resolution;
uniform float time;
vec2 hash(vec2 p){p=vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3)));return fract(sin(p)*43758.5453);} 
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy; uv.x*=resolution.x/resolution.y;
 vec2 g=uv*8.0,id=floor(g),f=fract(g); float d=9.0; vec2 cell=vec2(0.0);
 for(int y=-1;y<=1;y++)for(int x=-1;x<=1;x++){vec2 o=vec2(float(x),float(y));vec2 r=hash(id+o);float nd=length(o+r-f);if(nd<d){d=nd;cell=id+o;}}
 float lead=smoothstep(0.06,0.025,d);
 vec3 glass=0.5+0.5*cos(vec3(0.0,2.2,4.4)+hash(cell).x*6.283+time*0.05);
 gl_FragColor=vec4(mix(glass*0.85,vec3(0.02),lead),1.0);
}
runnable fragment

Topographic Contour Terrain

stronghold-curated pattern 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(113.5,271.9)))*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<5;i++){v+=a*noise(p);p*=2.0;a*=0.5;}return v;}
void main(){
 vec2 uv=gl_FragCoord.xy/resolution.xy; uv.x*=resolution.x/resolution.y;
 float h=fbm(uv*4.0+0.05*sin(time));
 float lines=1.0-smoothstep(0.0,0.035,abs(fract(h*12.0)-0.5));
 vec3 land=mix(vec3(0.05,0.13,0.08),vec3(0.72,0.55,0.28),h);
 gl_FragColor=vec4(land+lines*vec3(0.9,0.85,0.55),1.0);
}