[Bf-blender-cvs] [de7563c91ac] temp-lineart-contained: LineArt: Better tolerance for faces that are perpendicular to view vector.

YimingWu noreply at git.blender.org
Wed Jun 2 13:39:45 CEST 2021


Commit: de7563c91ac0fb605bd0ee7617df6121fcff7e29
Author: YimingWu
Date:   Wed Jun 2 17:13:23 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBde7563c91ac0fb605bd0ee7617df6121fcff7e29

LineArt: Better tolerance for faces that are perpendicular to view vector.

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

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

M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

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

diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 4d70c0adca7..e9810294820 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -2336,7 +2336,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) {
+  /* FIXME: 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;
   }



More information about the Bf-blender-cvs mailing list