#pragma iChannel0 BufferA
#define SF 1./min(iResolution.x,iResolution.y)

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

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{    
    vec2 uv = (fragCoord - .5*iResolution.xy)/iResolution.y;
    vec2 ouv = fragCoord/iResolution.xy;
    
    vec3 pPoses[6] = vec3[6](
        vec3(.25, .25, .05),
        vec3(-.15, .13, .08),
        vec3(.12, -.20, .1),
        vec3(.28, -.30, .13),
        vec3(.05, .3, .18),
        vec3(-.3, -.3, .3)
    );
    
    float p = 0.;
    for(int i=0; i<6; i++){
        vec3 pd = pPoses[i];
    	p += smoothstep(pd.z, .0, length(uv - pd.xy));
    }        
    
    uv *= rot(iTime*2.);
            
    float m = smoothstep(.025, 0., abs(uv.y)) * smoothstep(0., .1, uv.x) * smoothstep(.51, .49, uv.x);       
    
    vec3 backCol = texture(iChannel0, ouv).rgb*(p >0. ? min(.9+p*.1, 0.99) : .9);
    
    vec3 col = mix(backCol, vec3(0, 1., 0.), m);
    
    fragColor = vec4(col,1.0);
}