LineArt: Tolerance for faces perpendicular to view

This is due to cam->obmat precision issue,
where it affects view vector precision.

Reviewed by Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11461
This commit is contained in:
YimingWu 2021-06-02 20:55:54 +08:00
parent a55b73417f
commit 5b176b66da
1 changed files with 5 additions and 1 deletions

View File

@ -2064,7 +2064,11 @@ static bool lineart_triangle_edge_image_space_occlusion(SpinLock *UNUSED(spl),
dot_r = dot_v3v3_db(Rv, tri->gn);
dot_f = dot_v3v3_db(Cv, tri->gn);
if (!dot_f) {
/* NOTE(Yiming): When we don't use `dot_f==0` here, it's theoretically possibile that _some_
* faces in perspective mode would get erroneously caught in this condition where they really are
* legit faces that would produce occlusion, but haven't encountered those yet in my test files.
*/
if (fabs(dot_f) < FLT_EPSILON) {
return false;
}