uniform vec2 u_resolution;
vec2 pos = gl_FragCoord.xy/u_resolution;
vec2 multC(vec2 a, vec2 b){
float re = a.x*b.x - a.y*b.y;
float im = a.x*b.y + a.y*b.x;
vec2 divC(vec2 a, vec2 b){
return vec2(a.x*b.x+a.y*b.y,a.y*b.x-a.x*b.y)/(b.x*b.x+b.y*b.y);
vec2 Scale(vec2 p, float scale){
return (scale*p-u_resolution.xy)/u_resolution.y;
const vec2 raiz1 = vec2( 1,0.00001);
const vec2 raiz2 = vec2(-.5, .86603);
const vec2 raiz3 = vec2(-.5,-.86603);
vec2 metodoNewton(vec2 z){
const int max_iteraciones = 64;
for(int i=0;i<max_iteraciones;i++){
if (float(i)>fract(u_time*0.018)*48.){
vec2 polinomio = vec2( z.x*z.x*z.x - 3.*z.x*z.y*z.y, 3.*z.x*z.x*z.y - z.y*z.y*z.y )-vec2(1,0);
vec2 derivada = 3.*vec2( z.x*z.x - z.y*z.y, 2.*z.x*z.y );
vec2 pos = uv() *1. - vec2(0.020,-0.140);
vec2 z = metodoNewton(pos);
float dr1 = distance(z,raiz1);
float dr2 = distance(z,raiz2);
float dr3 = distance(z,raiz3);
color = vec3(0.484/(1./dr1+1./dr2+1./dr3));
gl_FragColor = vec4(color,1.);