[Bf-blender-cvs] [e2166dc2174] temp-lineart-contained: LineArt: Intersection function additional clamping

YimingWu noreply at git.blender.org
Tue Dec 28 04:20:01 CET 2021


Commit: e2166dc2174e4face0d263043bf438152badbd3c
Author: YimingWu
Date:   Tue Dec 28 11:19:28 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBe2166dc2174e4face0d263043bf438152badbd3c

LineArt: Intersection function additional clamping

To handle a rare case where it leads to a -1 index in isect order lookup

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

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 3ddf8222157..cb0032c31e0 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -2697,8 +2697,10 @@ static bool lineart_triangle_edge_image_space_occlusion(SpinLock *UNUSED(spl),
         INTERSECT_JUST_GREATER(is, order, is[LCross], RCross);
       }
       else {
-        INTERSECT_JUST_GREATER(is, order, is[LCross], LCross);
-        INTERSECT_JUST_GREATER(is, order, is[LCross], RCross);
+        INTERSECT_JUST_GREATER(is, order, 1 - DBL_TRIANGLE_LIM, LCross);
+        if (LCross > 0) {
+          INTERSECT_JUST_GREATER(is, order, is[LCross], RCross);
+        }
       }
     }
   }



More information about the Bf-blender-cvs mailing list