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

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);
}