// $LastChangedDate: 2009-12-14 13:08:18 -0500 (Mon, 14 Dec 2009) $

    // Compute fog.
    // {1.0:max...0.0:none}
    float fog = 1.0 - clamp( exp( -uni_fogDensity * gl_FogFragCoord ), 0.0, 1.0 );
    if ( fog < uni_fogMin )  // uni_fogMin is in unit range
        fog = uni_fogMin;    // for near objects to have some fog
    gl_FragColor.rgb = vec3( mix( gl_FragColor, uni_fogColor, fog ) );
