LineArt: Correct clamping of out of bound isect index

Handles rare cases where line doesn't intersect the triangle correctly.
This commit is contained in:
YimingWu 2021-12-31 21:25:03 +08:00
parent d09b1d2759
commit 97ae08c9fc
Notes: blender-bot 2023-04-04 07:45:26 +02:00
Referenced by issue #93479, 3.0 Potential candidates for corrective releases
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}
}
}
}
}