Fix: Overlay: Broken outline detection for faces perpedicular to the view
Apply the same fix used for Armatures. Partially fixes #139555. For correct flat object detection, #145227 is also needed. (4.5 backport candidate) Pull Request: https://projects.blender.org/blender/blender/pulls/147722
This commit is contained in:
@@ -107,7 +107,7 @@ void geometry_main(VertOut geom_in[4],
|
||||
float fac3 = dot(view_vec, n3);
|
||||
|
||||
/* If one of the face is perpendicular to the view,
|
||||
* consider it and outline edge. */
|
||||
* consider it an outline edge. */
|
||||
if (abs(fac0) > 1e-5f && abs(fac3) > 1e-5f) {
|
||||
/* If both adjacent verts are facing the camera the same way,
|
||||
* then it isn't an outline edge. */
|
||||
|
||||
@@ -91,10 +91,14 @@ void geometry_main(VertOut geom_in[4],
|
||||
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 an outline edge. */
|
||||
if (abs(fac0) > 1e-5f && abs(fac3) > 1e-5f) {
|
||||
/* If both adjacent verts are facing the camera the same way,
|
||||
* then it isn't an outline edge. */
|
||||
if (sign(fac0) == sign(fac3)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
VertOut export_vert = (out_vertex_id == 0) ? geom_in[1] : geom_in[2];
|
||||
|
||||
Reference in New Issue
Block a user