Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2021-12-31 16:25:03 +0300
committerYimingWu <xp8110@outlook.com>2021-12-31 16:26:39 +0300
commit97ae08c9fcca55179f72f9bc318cc750e8f9d8a4 (patch)
tree05b4344f65711ec26579d2b5d8db298a40d4fad2 /source
parentd09b1d2759861aa012ab2e7e4ce2ffa2b56bd9d3 (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')
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c8
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);
+ }
+ }
}
}
}