#ifdef UNDERWATER_FOG
	if (isEyeInWater == 1) {
		color.rgb = calcUnderwaterFogColor(color.rgb, dist, eyeBrightnessSmooth.y / 240.0);
	}
	else {
#endif
		#ifdef FOG_ENABLED_TF
			float d = dist - 0.2; //wetness * 0.3 * eyeBrightness / 240.0
			if (d > 0.0) {
				d = fogify(d * exp2(1.5 - (worldPos.y + cameraPosition.y) * 0.015625), FOG_DISTANCE_MULTIPLIER_TF);
				color.rgb = mix(calcFogColor(posNorm) * min(max(lmcoord.y * 2.0, eyeBrightness.y / 120.0), 1.0), color.rgb, d);
			}
		#endif
#ifdef UNDERWATER_FOG
	}
#endif