#https://www.shadertoy.com/view/lslSR7

pixels = W:1024 H:1024

x = from -10 to 10 W
y = from -10 to 10 H

t = 190.38

r = smoothstep(-0.7, 0.7, sin(t*1.57-length2(x, y)*0.1))+1.0
r3 = sqrt(3)
rpx = 4
rpy = r3*4

p1x = mod(x, rpx)-rpx*0.5
p1y = mod(y, rpy)-rpy*0.5
p2x = mod(x+2.0, rpx)-rpx*0.5
p2y = mod(y    , rpy)-rpy*0.5
p3x = mod(x+1.0, rpx)-rpx*0.5
p3y = mod(y+ r3, rpy)-rpy*0.5
p4x = mod(x+3.0, rpx)-rpx*0.5
p4y = mod(y+ r3, rpy)-rpy*0.5
p5x = mod(x       , rpx)-rpx*0.5
p5y = mod(y+r3*2.0, rpy)-rpy*0.5
p6x = mod(x+   2.0, rpx)-rpx*0.5
p6y = mod(y+r3*2.0, rpy)-rpy*0.5
p7x = mod(x+   1.0, rpx)-rpx*0.5
p7y = mod(y+r3*3.0, rpy)-rpy*0.5
p8x = mod(x+   3.0, rpx)-rpx*0.5
p8y = mod(y+r3*3.0, rpy)-rpy*0.5

c = 0.0
c = c + smoothstep(0.1, 0.0, abs(length2(p1x, p1y) - r))
c = c + smoothstep(0.1, 0.0, abs(length2(p2x, p2y) - r))
c = c + smoothstep(0.1, 0.0, abs(length2(p3x, p3y) - r))
c = c + smoothstep(0.1, 0.0, abs(length2(p4x, p4y) - r))
c = c + smoothstep(0.1, 0.0, abs(length2(p5x, p5y) - r))
c = c + smoothstep(0.1, 0.0, abs(length2(p6x, p6y) - r))
c = c + smoothstep(0.1, 0.0, abs(length2(p7x, p7y) - r))
c = c + smoothstep(0.1, 0.0, abs(length2(p8x, p8y) - r))

k = r + 0.7

r = hsv_r(k, 1.0, c)
g = hsv_g(k, 1.0, c)
b = hsv_b(k, 1.0, c)
