//varying lowp vec4 DestinationColor;
varying vec2 TexCoordOut; // New
uniform sampler2D Texture; // New
uniform vec4 SourceColor;


void main(void) {
    //gl_FragColor = DestinationColor * texture2D(Texture, TexCoordOut);
    vec4 alphaAmount = texture2D(Texture, TexCoordOut);
    float colorA = (alphaAmount.r+alphaAmount.g+alphaAmount.b)/3.0;
    gl_FragColor =  vec4(SourceColor.r*colorA, SourceColor.g*colorA, SourceColor.b*colorA, alphaAmount.a);
}

