Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-08-21 18:35:02 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-08-22 14:51:03 +0300
commitfdce78c9362a52086bd3d8591b5013cfaf5196f2 (patch)
treec5c8e9d1f2493c53a1acc7ee481011b72d635e3c /source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl
parent9d65be6b42ce503625a3b1cd336b2b0db1ca8876 (diff)
Armature: Fix outline jitter in orthographic mode
Diffstat (limited to 'source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl')
-rw-r--r--source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl b/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl
index 91468bf920a..bcfa097b277 100644
--- a/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl
+++ b/source/blender/draw/modes/shaders/armature_shape_outline_geom.glsl
@@ -64,10 +64,14 @@ void main(void)
float fac0 = dot(view_vec, n0);
float fac3 = dot(view_vec, n3);
- /* If both adjacent verts are facing the camera the same way,
- * then it isn't an outline edge. */
- if (sign(fac0) == sign(fac3))
- return;
+ /* If one of the face is perpendicular to the view,
+ * consider it and outline edge. */
+ if (abs(fac0) > 1e-5 && abs(fac3) > 1e-5) {
+ /* If both adjacent verts are facing the camera the same way,
+ * then it isn't an outline edge. */
+ if (sign(fac0) == sign(fac3))
+ return;
+ }
/* Don't outline if concave edge. */
if (dot(n0, v13) > 0.0001)