From 14c1a77f8a0278f5a25d50d61de8f0728145294f Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Thu, 13 Oct 2016 18:08:04 +0200 Subject: [PATCH] Fix AmbientOcclusionColor bug where pixelpos was assumed to be in eye space coordinates --- wadsrc/static/shaders/glsl/main.fp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);