[Bf-blender-cvs] [fca069a7053] blender-v2.82-release: Fix T72547 Wireframe overlay clipping issues

Clément Foucault noreply at git.blender.org
Tue Jan 14 16:55:20 CET 2020


Commit: fca069a705318f58aece433318556fb06c99e842
Author: Clément Foucault
Date:   Tue Jan 14 13:07:39 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBfca069a705318f58aece433318556fb06c99e842

Fix T72547 Wireframe overlay clipping issues

The view vector was not correct in orthographic view.

Also reduce the curvature bias a little.

===================================================================

M	source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl

===================================================================

diff --git a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
index 21f8bcf1791..a2fa82d151e 100644
--- a/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
+++ b/source/blender/draw/engines/overlay/shaders/wireframe_vert.glsl
@@ -105,7 +105,7 @@ void main()
   vec3 wnor = normalize(normal_object_to_world(nor));
 
   bool is_persp = (ProjectionMatrix[3][3] == 0.0);
-  vec3 V = (is_persp) ? normalize(ViewMatrixInverse[3].xyz - wpos) : ViewMatrix[2].xyz;
+  vec3 V = (is_persp) ? normalize(ViewMatrixInverse[3].xyz - wpos) : ViewMatrixInverse[2].xyz;
 
   float facing = dot(wnor, V);
   float facing_ratio = clamp(1.0 - facing * facing, 0.0, 1.0);
@@ -120,7 +120,7 @@ void main()
   gl_Position.xy += wofs.xy * sizeViewportInv.xy * gl_Position.w;
 
   /* Push the vertex towards the camera. Helps a bit. */
-  gl_Position.z -= facing_ratio * curvature * 1e-4;
+  gl_Position.z -= facing_ratio * curvature * 4.0e-5;
 
   /* Convert to screen position [0..sizeVp]. */
   edgeStart = ((gl_Position.xy / gl_Position.w) * 0.5 + 0.5) * sizeViewport.xy;



More information about the Bf-blender-cvs mailing list