[Bf-blender-cvs] [5b176b66da1] master: LineArt: Tolerance for faces perpendicular to view

YimingWu noreply at git.blender.org
Wed Jun 2 14:56:24 CEST 2021


Commit: 5b176b66da1f85f19e042f69dc302e8e72e0dc44
Author: YimingWu
Date:   Wed Jun 2 20:55:54 2021 +0800
Branches: master
https://developer.blender.org/rB5b176b66da1f85f19e042f69dc302e8e72e0dc44

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

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

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 0b439c20d65..b546aaa683e 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -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;
   }



More information about the Bf-blender-cvs mailing list