#version 420

uniform sampler2D copyTex;
uniform float flipX=0.0;
uniform float flipY=1.0;

in vec2 fragTexCoord;
out vec4 result;

uniform ColorDisk {
   vec4 diskColor[2];
   float innerRadius;
   float outerRadius;
};

void main( void ) {
    bvec2 flip = bvec2( (flipX > 0.5), (flipY > 0.5) );
    vec4 texColor = texture( copyTex, 
                                vec2( flip.x ? 1.0-fragTexCoord.x : fragTexCoord.x, 
                                      flip.y ? 1.0-fragTexCoord.y : fragTexCoord.y ) );
                                      
	float dist = length( 2.0*fragTexCoord-1.0 );  
    
    result = mix( diskColor[0], diskColor[1], smoothstep( innerRadius, outerRadius, dist ) ) * texColor;
}