Sha256: 5a8faf4e508ae293bfe9fdc9c751ba710fd9b17ff3010e9c5ec0f22533ea0671
Contents?: true
Size: 1.31 KB
Versions: 21
Compression:
Stored size: 1.31 KB
Contents
#version 330 core out vec4 color_out; uniform float iGlobalTime; uniform vec2 iMouse; uniform vec2 iResolution; // https://www.shadertoy.com/view/lslSR7 vec3 hsv(float h,float s,float v) { return mix(vec3(1.),clamp((abs(fract(h+vec3(3.,2.,1.)/3.)*6.-3.)-1.),0.,1.),s)*v; } float circle(vec2 p, float r) { return smoothstep(0.1, 0.0, abs(length(p)-r)); // try changing the 0.1 to 0.3 } float r3 = sqrt(3.0); void mainImage( out vec4 fragColor, in vec2 fragCoord ) { vec2 uv = -1.0 + 2.0*fragCoord.xy / iResolution.xy; uv.x *= iResolution.x/iResolution.y; uv *= 10.0; float r = smoothstep(-0.7, 0.7, sin(iGlobalTime*1.57-length(uv)*0.1))+1.0; vec2 rep = vec2(4.0,r3*4.0); vec2 p1 = mod(uv, rep)-rep*0.5; vec2 p2 = mod(uv+vec2(2.0,0.0), rep)-rep*0.5; vec2 p3 = mod(uv+vec2(1.0,r3), rep)-rep*0.5; vec2 p4 = mod(uv+vec2(3.0,r3), rep)-rep*0.5; vec2 p5 = mod(uv+vec2(0.0,r3*2.0), rep)-rep*0.5; vec2 p6 = mod(uv+vec2(2.0,r3*2.0), rep)-rep*0.5; vec2 p7 = mod(uv+vec2(1.0,r3*3.0), rep)-rep*0.5; vec2 p8 = mod(uv+vec2(3.0,r3*3.0), rep)-rep*0.5; float c = 0.0; c += circle(p1, r); c += circle(p2, r); c += circle(p3, r); c += circle(p4, r); c += circle(p5, r); c += circle(p6, r); c += circle(p7, r); c += circle(p8 , r); fragColor = vec4(hsv(r+0.7, 1.0, c), 1.0); } void main(){mainImage(color_out,gl_FragCoord.xy);}
Version data entries
21 entries across 21 versions & 1 rubygems