From 2ea64d2dc1419e6d6ea7541ce329dc696e26c10a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 6 Aug 2017 21:56:54 -0300 Subject: Use vertex distance instead of z, fixes #9108 --- drivers/gles3/shaders/scene.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 340a1f24d2..efb82441f4 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1929,7 +1929,7 @@ FRAGMENT_SHADER_CODE if (fog_depth_enabled) { - float fog_z = smoothstep(fog_depth_begin,z_far,-vertex.z); + float fog_z = smoothstep(fog_depth_begin,z_far,length(vertex)); fog_amount = pow(fog_z,fog_depth_curve); if (fog_transmit_enabled) { -- cgit v1.2.3