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
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2021-12-28 06:19:28 +0300
committerYimingWu <xp8110@outlook.com>2021-12-28 06:21:25 +0300
commit0a68fa8e14bdafaa2bc456981a571a3f65ad8b76 (patch)
tree3e045dd431af6bea58feafb9b6c22b5624a13881 /source/blender/gpencil_modifiers
parent8c4edd1b379d486d3a4755573861509e2b921f64 (diff)
LineArt: Intersection function additional clamping
To handle a rare case where it leads to a -1 index in isect order lookup
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c6
1 files changed, 4 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..a5cffb822c8 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -2585,8 +2585,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);
+ }
}
}
}