     vec3(.6),
     40
 };
+
+float computeFogFactor()
+{
+    float dist = abs(fragPosition.z);
+    float fogFactor = (fogInfo.maxDistance - abs(fragPosition.z)) / (fogInfo.maxDistance - fogInfo.minDistance);
+    fogFactor = clamp(fogFactor, 0.0, 1.0);
+    return fogFactor;
+}
 
 vec3 phongModel(in vec4 lightPosition)
 {

    vec3 specular;
    float specularShininess;
};

const uint nbLights = 2u;
uniform LightSource lightSources[nbLights] = {

smooth in vec3 fragNormal;

out vec4 fragColor;

struct FogInfo
{
    float minDistance;
    float maxDistance;
    vec3 color;
};

struct LightSource
{
