
module.exports =
    `
#ifdef GL_ES
precision lowp float;
#endif
varying vec4 v_fragmentColor;
varying vec2 v_texCoord;
uniform float u_scaleX;
uniform float a;
uniform float b;


vec4 ellipse( vec2 uv, vec2 center, float a, float b , vec3 color_fill, float strokeWidth, float antialias  ){
    float a2 = a*a;
	float b2 = b*b;
	float x2 = ( uv.x - center.x )*( uv.x - center.x );
	float y2 = ( uv.y - center.y )*( uv.y - center.y );
	float d = (x2*b2 + y2*a2 - a2*b2)/( a2*b2 );
    
    if( d < 0.0001 ){
        float t = smoothstep( 0.0, 0.01, d );
        return vec4( color_fill, 1. - t );
    }else{//描边
        float t = smoothstep( 0.0, 0.05, d-strokeWidth );
        return vec4(0.0, 0.0, 0.0, 1.0-t);
    }
}


void main()
{
    vec4 src_color = texture2D(CC_Texture0, v_texCoord).rgba;
	vec2 uv= v_texCoord.xy;  
	uv = 2.0*uv - 1.0 ;
	vec2 center = vec2(0.0, 0.0);	
	vec4 color_red = vec4( 1.0, 0.0, 0.0, 1.0);
	vec4 layer1 = vec4(src_color.rgb, 1.0);
	vec4 layer2 = ellipse(uv, center, a, b, color_red.rgb, 0.02,1.0);
	// gl_FragColor = mix(layer1, layer2, layer2.a);
	gl_FragColor = vec4( 1.0, 0.0, 0.0, 0.5);
}
`