Explorar o código

Use vertex distance instead of z, fixes #9108

Juan Linietsky %!s(int64=8) %!d(string=hai) anos
pai
achega
2ea64d2dc1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      drivers/gles3/shaders/scene.glsl

+ 1 - 1
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) {