#ifdef GL_ES precision mediump float; #endif uniform vec2 u_resolution; uniform vec2 u_mouse; uniform float u_time; // Function from IƱigo Quiles // https://www.shadertoy.com/view/MsS3Wc vec3 hsb2rgb( in vec3 c ){ vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0), 6.0)-3.0)-1.0, 0.0, 1.0 ); rgb = rgb*rgb*(3.0-2.0*rgb); return c.z * mix(vec3(1.0), rgb, c.y); } void main() { float steps = 10.0; vec2 st = gl_FragCoord.xy/u_resolution.xy; float dist = distance(vec2(0.5), st); float space = mod(dist * 20.0 - u_time * 2.0, steps); vec3 color = hsb2rgb(vec3(ceil(space) / steps, 1.0, fract(space))); gl_FragColor = vec4(color, 1.0); }