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()
{
    //vec3 lightVector = normalize(u_LightPos - v_Position);                 // Get a lighting direction vector from the light to the vertex.
    //float diffuse = max(dot(v_Normal, lightVector), 0.2);                  // Calculate the dot product of the light vector and vertex normal. If the normal and light vector are
                                                                           // pointing in the same direction then it will get max illumination.

    gl_FragColor = texture2D(u_Texture, v_TexCoordinate).rgba * max(dot(v_Normal, normalize(u_LightPos - v_Position)), 0.2);
    gl_FragColor.a = 1.0;
}