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




void main(void) {
    //gl_FragColor = DestinationColor * texture2D(Texture, TexCoordOut);
    vec4 theColor = texture2D(Texture, TexCoordOut);
    float theValue = (theColor.r+theColor.g+theColor.b)/3.0;
    if (GlowAmount<0.5){
        theColor = vec4(theValue,0,0,theColor.a);
    } else {
        theColor = vec4(0,theValue,0,theColor.a);
    }
    gl_FragColor =  theColor;
}

