diff --git a/wadsrc/static/shaders/glsl/main.fp b/wadsrc/static/shaders/glsl/main.fp index e26b2fd4a..5ab9f1118 100644 --- a/wadsrc/static/shaders/glsl/main.fp +++ b/wadsrc/static/shaders/glsl/main.fp @@ -287,7 +287,7 @@ vec3 AmbientOcclusionColor() } else { - fogdist = max(16.0, length(pixelpos.xyz)); + fogdist = max(16.0, distance(pixelpos.xyz, uCameraPos.xyz)); } fogfactor = exp2 (uFogDensity * fogdist);