#https://www.shadertoy.com/view/4dfGRn

pixels = W:1024 H:1024

x = from -0 to 1 W
y = from -0 to 1 H

t = 12.7835
ccx = 1.1*( 0.5*cos(0.1*t) - 0.25*cos(0.2*t) )
ccy = 1.1*( 0.5*sin(0.1*t) - 0.25*sin(0.2*t) )

zx = (-1.0 + 2.0*x)*1.7
zy = -1.0 + 2.0*y

dx = 1000
dy = 1000
dz = 1000
dw = 1000

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

zz = ccx + zx*zx - zy*zy
zy = ccy + 2.0*zx*zy
zx = zz
dx = min(dx, abs(0.0+zy + 0.5*sin(zx)))
dy = min(dy, abs(1.0+zx + 0.5*sin(zy)))
dz = min(dz, zx*zx + zy*zy)
dw = min(dw, length2(fract(zx)-0.5, fract(zy)-0.5))

lx = min(1.0,pow(dx*0.25,0.20)) 
ly = min(1.0,pow(dy*0.50,0.50)) 
lz = 1.0-min(1.0,pow(dz*1.00,0.15))

r = mix(dw, 1.0, lx)
g = mix(dw, 0.8, lx)
b = mix(dw, 0.6, lx)

r = mix(r, 0.72, ly)
g = mix(g, 0.70, ly)
b = mix(b, 0.60, ly)

r = mix(r, 1.0, lz)
g = mix(g, 1.0, lz)
b = mix(b, 1.0, lz)

w = 0.5 + 0.5*pow(16.0*x*(1.0-x)*y*(1.0-y),0.15)

r = 1.25*r*r*w
g = 1.25*g*g*w
b = 1.25*b*b*w
