diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-07-21 13:08:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-07-21 13:08:25 +0300 |
commit | 4e28d88ece20fabd773a0a2e7b3423227358b7c7 (patch) | |
tree | 38a33e906bbfb3dc1c04f637daf7bbc829db04f4 | |
parent | 9fbef5d5d5cd172aa8225134213fb0c3eeea1009 (diff) |
Fix T51724: Blender 2.80 EEVEE, Cycles, Clay Black Wall Graphical Glitch
-rw-r--r-- | source/blender/draw/modes/shaders/object_grid_frag.glsl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/draw/modes/shaders/object_grid_frag.glsl b/source/blender/draw/modes/shaders/object_grid_frag.glsl index 0196b1a6f98..61bd4d58a4a 100644 --- a/source/blender/draw/modes/shaders/object_grid_frag.glsl +++ b/source/blender/draw/modes/shaders/object_grid_frag.glsl @@ -75,7 +75,11 @@ vec3 get_floor_pos(vec2 uv, out vec3 wPos) camera_vec = normalize(eye); } - float p = -dot(planeNormal, camera_pos) / dot(planeNormal, camera_vec); + float plane_normal_dot_camera_vec = dot(planeNormal, camera_vec); + float p = -dot(planeNormal, camera_pos); + if (plane_normal_dot_camera_vec != 0) { + p /= plane_normal_dot_camera_vec; + } vec3 plane = camera_pos + camera_vec * p; /* fix residual imprecision */ |