Commit: b2188d631a81972f38548a333757eb21ddd784b0
Author: Clément Foucault
Date:   Sat May 5 20:33:57 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb2188d631a81972f38548a333757eb21ddd784b0

Armature: Outline: Fix outline detection in critical cases.

Outline was not generated because the normal was completely orthogonal to
the view.

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

M       source/blender/draw/modes/shaders/armature_shape_outline_vert.glsl

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

diff --git a/source/blender/draw/modes/shaders/armature_shape_outline_vert.glsl 
b/source/blender/draw/modes/shaders/armature_shape_outline_vert.glsl
index 73916163b9a..0d09114579c 100644
--- a/source/blender/draw/modes/shaders/armature_shape_outline_vert.glsl
+++ b/source/blender/draw/modes/shaders/armature_shape_outline_vert.glsl
@@ -45,7 +45,13 @@ void main()
         * barelly visible at the outline corners. */
        ssNor = normalize((NormalMatrix * snor).xy);
 
-       vFacing = dot(V, normalize(NormalMatrix * nor));
+       vec3 normal = normalize(NormalMatrix * nor);
+       /* Add a small bias to avoid loosing outline
+        * on faces orthogonal to the view.
+        * (test case: octahedral bone without rotation in front view.) */
+       normal.z += 1e-6;
+
+       vFacing = dot(V, normal);
 
        ssPos = proj(pPos);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to