#ifdef GL_ES
precision mediump float;
#endif

uniform sampler2D texSampler;
uniform vec4 magicColor;
uniform float testAlpha;

varying lowp vec4 vColor;
varying vec2 vTexCoords;

void main() {
    vec4 frag = texture2D(texSampler, vTexCoords);
    frag *= vColor;
    if (frag.a <= testAlpha)
        discard;
    gl_FragColor = vec4(1, 1, 1, 1) * frag.a;
}