 //}
 
 
-vec3 calc_directional_light(directionalLight_t light, vec3 normal, vec3 viewDir) {
+vec3 calc_directional_light(directionalLight_t light, vec3 normal, vec3 fragPosition, vec3 viewDir) {
+
+    //
+    // TODO: determine the correct light direction to use
+    //
     vec3 lightDir = normalize(-light.direction);
+    //vec3 lightDir = normalize(light.direction - fragPosition);
+
     vec3 norm = normalize(normal);
 
     // ambient
-    vec3 ambient = light.ambient * vec3(texture(material.diffuseMap, f_texcoord));
+    vec3 ambient = light.ambient * material.ambient * vec3(texture(material.diffuseMap, f_texcoord));
 
     // diffuse
     float diff = max(dot(norm, lightDir), 0.0f);

    return(ambient + diffuse + specular);
}

vec3 calc_spot_light(spotLight_t light, vec3 normal, vec3 viewDir) {

    //
    // TODO: implement
    //

    //

    return vec3(0,0,0);
}

void main() {
    vec3 viewDir = normalize(viewPos - f_position);
    vec3 result = calc_point_light(pointlight, f_normal, f_position, viewDir);

#if 0
    result += calc_directional_light(directionalLight, f_normal, viewDir);
#else
    vec3 directionalOutput = calc_directional_light(directionalLight, f_normal, viewDir);
    directionalOutput = result;
#endif


#if 0
    result += calc_spot_light(spotLight, f_normal, viewDir);
#else
    vec3 spotOutput = calc_spot_light(spotLight, f_normal, viewDir);
    spotOutput = result;
#endif


out vec4 color;


vec3 calc_directional_light(directionalLight_t light, vec3 normal, vec3 fragPosition, vec3 viewDir);
vec3 calc_point_light(pointLight_t light, vec3 normal, vec3 fragPosition, vec3 viewDir);
vec3 calc_spot_light(spotLight_t light, vec3 normal, vec3 fragPosition, vec3 viewDir);


//
