#define fogMult 1.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0]

vec3 blindFogMix(vec3 color, vec3 eyePos)
{
    return mix(color, vec3(0.0), clamp01(blindness + darknessFactor) * clamp01(pow(length(pow(eyePos.xz, vec2(4.0)))/far, 0.025)));
}

vec3 fogMix(vec3 color, vec3 skyData, vec3 eyePos)
{
    #if fogMult == 0.0
    return color;
    #endif
    
    vec3 fogMixture = mix(color, skyData, clamp01(pow2(length(eyePos.xz)/far)*fogMult));
    return blindFogMix(fogMixture, eyePos);
}