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

Fragment

zero-x7444ff-shader-art material glsl runnable fragment MIT
code snippet
precision mediump float;
uniform sampler2D uTexture;
uniform float uTextureFrequency;
uniform float u_time;
uniform float uHslTimeFrequency;
uniform float uHslHue;
uniform float uHslHueOffset;
uniform float uHslHueFrequency; 
uniform float uHslLightness; 
uniform float uHslLightnessVariation; 
uniform float uHslLightnessFrequency; 
uniform float uTextureOffset; 

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

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

Sidegrid

tangram-procedural-textures pattern glsl runnable fragment MIT
code snippet
precision mediump float;
varying vec2 v_texcoord;
vec2 tile(vec2 _st, float _zoom){
  _st *= _zoom;
  return fract(_st);
}

float X(vec2 _st, float _width){
  float pct0 = smoothstep(_st.x-_width,_st.x,_st.y);
  pct0 *= 1.-smoothstep(_st.x,_st.x+_width,_st.y);

  float pct1 = smoothstep(_st.x-_width,_st.x,1.0-_st.y);
  pct1 *= 1.-smoothstep(_st.x,_st.x+_width,1.0-_st.y);
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

Star

tangram-procedural-textures pattern glsl runnable fragment MIT
code snippet
precision mediump float;
uniform float u_time;
varying vec2 v_texcoord;
#define PI 3.14159265358979323846
#define TWO_PI 6.28318530717958647693
#define PHI 1.618033988749894848204586834

vec2 radialTile(vec2 _st, vec2 _vel, float _zoom){
  vec2 toExtreme = vec2(0.5)-_st;
  vec2 polar = vec2( (PI+atan(toExtreme.y,toExtreme.x))/TWO_PI,   // Angle
                      log(length(toExtreme))*PHI*0.1);            // Radius
  polar *= _zoom;

  polar.y += _vel.y;
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);
}
runnable fragment

Wave

tangram-procedural-textures pattern glsl runnable fragment MIT
code snippet
precision mediump float;
varying vec2 v_texcoord;
#define PI 3.14159265358979323846

float plotX(vec2 _st, float _pct,float _antia){
  return  smoothstep( _pct-_antia, _pct, _st.x) - 
          smoothstep( _pct, _pct+_antia, _st.x);
}

float plotY(vec2 _st, float _pct,float _antia){
  return  smoothstep( _pct-_antia, _pct, _st.y) - 
          smoothstep( _pct, _pct+_antia, _st.y);
}