precision mediump float;       		// Set the default precision to medium. We don't need as high of a
                                    // precision in the fragment shader.

uniform vec3 u_LightPos;       	    // The position of the light in eye space.
uniform sampler2D u_Texture;        // The input texture.

varying vec3 v_Position;			// Interpolated position for this fragment.
varying vec3 v_Normal;         		// Interpolated normal for this fragment.
varying vec2 v_TexCoordinate;       // Interpolated texture coordinate per fragment.

void main()
{
    gl_FragColor = texture2D(u_Texture, v_TexCoordinate).rgba * max(dot(v_Normal, normalize(u_LightPos - v_Position)), 0.2);

    float gray = dot(gl_FragColor.rgb, vec3(0.299, 0.587, 0.114));
    gl_FragColor = vec4(gray, gray, 0.0, 1.0);
}