Armature: Fix outline jitter in orthographic mode

This commit is contained in:
Clément Foucault 2018-08-21 17:35:02 +02:00
parent 9d65be6b42
commit fdce78c936
1 changed files with 8 additions and 4 deletions

View File

@ -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)