Fix AmbientOcclusionColor bug where pixelpos was assumed to be in eye space coordinates

This commit is contained in:
Magnus Norddahl 2016-10-13 18:08:04 +02:00
parent 660a45a0e0
commit 14c1a77f8a

View file

@ -287,7 +287,7 @@ vec3 AmbientOcclusionColor()
} }
else else
{ {
fogdist = max(16.0, length(pixelpos.xyz)); fogdist = max(16.0, distance(pixelpos.xyz, uCameraPos.xyz));
} }
fogfactor = exp2 (uFogDensity * fogdist); fogfactor = exp2 (uFogDensity * fogdist);