summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-08-06 21:56:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-08-06 21:57:40 -0300
commit2ea64d2dc1419e6d6ea7541ce329dc696e26c10a (patch)
tree162f1c6dbb128e7f40190bc1dda629886ddb8683 /drivers
parent134b3edf5a34eb05322f064a9194c0ea81c39f6c (diff)
Use vertex distance instead of z, fixes #9108
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/shaders/scene.glsl2
1 files changed, 1 insertions, 1 deletions
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) {