diff options
author | YimingWu <xp8110@outlook.com> | 2021-12-31 16:25:03 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2021-12-31 16:26:39 +0300 |
commit | 97ae08c9fcca55179f72f9bc318cc750e8f9d8a4 (patch) | |
tree | 05b4344f65711ec26579d2b5d8db298a40d4fad2 /source/blender/gpencil_modifiers | |
parent | d09b1d2759861aa012ab2e7e4ce2ffa2b56bd9d3 (diff) |
LineArt: Correct clamping of out of bound isect index
Handles rare cases where line doesn't intersect the triangle correctly.
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index 9241d256db0..9e1476d928e 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -2585,8 +2585,12 @@ 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); + if (LCross >= 0) { + INTERSECT_JUST_GREATER(is, order, is[LCross], LCross); + if (LCross >= 0) { + INTERSECT_JUST_GREATER(is, order, is[LCross], RCross); + } + } } } } |