     vec3 norm = normalize(Normal);
     vec3 viewDir = normalize(viewPos - FragPos);
 
+    // Calculate fragment shadow
+    float shadow = ShadowCalculation(FragPosLightSpace);
+
     // Phase 1: Directional lighting
-    vec3 result = CalcDirLight(dirLight, norm, viewDir, material);
+    vec3 result = CalcDirLight(dirLight, norm, viewDir, material, shadow);
 
     // Phase 2: Point lights
     result += CalcPointLight(light, norm, FragPos, viewDir, material);

    return (ambient + diffuse + specular);
}

uniform DirLight dirLight;

void main(void)

    // result += CalcSpotLight(spotLight, norm, FragPos, viewDir, material);

    color = vec4(result, 1.0f);
    //color = vec4(texture(shadowMap, UVCoords).r);
}
