#define SS 2

#define PI 3.14159265359
#define TAU (PI*2.)

vec3 subsample(vec2 fc){
    vec2 res= floor(iResolution.xy);
    vec2 uv = fc/res;
    vec2 s= uv*2.-1.;
    s.x*= res.x/res.y;
    uv= s;
        
    float r= length(uv);
    float t= mod(atan(uv.y,uv.x),TAU);
    float a= cos(t*10000.*iTime);
    vec3 cl= vec3(a);
    	
    return cl;
}
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
    vec2 fc = floor(fragCoord);
    
    vec3 c= vec3(0);
    for(int y=0; y!=SS; y++){
    	for(int x=0; x!=SS; x++){
            c+= subsample(fc + vec2(x,y)/float(SS));
        }
    }
    c/=float(SS*SS);
    //c= pow(c,vec3(1./2.4));//srgb
    //c+= rand(length(fc)+iTime)/250.;//dither
        
    fragColor= vec4(c,1);
}
