mat2 rot(float a) {
  return mat2(cos(a), -sin(a), sin(a), cos(a));
}

float hash(vec2 uv) {
  // added terms till it looked okay
  vec3 p3  = mod(uv.xyx * vec3(345.23,234.1,465.745),vec3(2,3,5));
  p3 += dot(p3, p3.yzx + 34.19);
  return fract((p3.x + p3.y) * p3.z);
}

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 uv = fragCoord.xy/iResolution.xy;
    vec2 puv = fragCoord.xy/iResolution.y;
    puv -= vec2(0.5*iResolution.x/iResolution.y, 0.5);

    float scol = length(texture(iChannel0,uv).rgb);
    vec3 col=texture(iChannel0,uv).rgb;
    
    
    for (float fl=0.; fl<10.; ++fl) {
      float myt = iTime + fl*2.42;
      vec2 fOff = vec2(hash(vec2(floor(myt/3.)))*3. -1.5,-1. + mod(myt-1.,3.));
      vec2 cuv = (puv-fOff) * rot(iTime*(3.+fl)/5.);
      
      
      
      for (int i=0; i < 5; ++i) {
        col = mix(col,vec3(scol)*0.3+0.7,smoothstep(0.1,0.09, length(cuv*vec2(0.6,1.2)-vec2(0.1,0))));
        cuv *= rot(3.1415*2./5.);
      }
      col=mix(col,(scol * 0.3 + 0.7)* vec3(1.,1.,0.),smoothstep(0.1,0.09,length(puv-fOff)));
      
    }

    // Output to screen
    fragColor = vec4(col,1.0);
}