LineArt: Occlusion accuracy fix.
This patch fixes occlusion function to handle one specific case (when an edge shares a point with triangle) better,especially when there's overlapping edges in this case.
This commit is contained in:
@@ -473,7 +473,8 @@ typedef struct LineartBoundingArea {
|
||||
BLI_INLINE int lineart_LineIntersectTest2d(
|
||||
const double *a1, const double *a2, const double *b1, const double *b2, double *aRatio)
|
||||
{
|
||||
#define USE_VECTOR_LINE_INTERSECTION
|
||||
/* Legacy intersection math aligns better with occlusion function quirks. */
|
||||
/* #define USE_VECTOR_LINE_INTERSECTION */
|
||||
#ifdef USE_VECTOR_LINE_INTERSECTION
|
||||
|
||||
/* from isect_line_line_v2_point() */
|
||||
|
||||
@@ -2475,8 +2475,8 @@ static bool lineart_triangle_edge_image_space_occlusion(SpinLock *UNUSED(spl),
|
||||
}
|
||||
}
|
||||
else if (st_r == 0) {
|
||||
INTERSECT_JUST_GREATER(is, order, 0, LCross);
|
||||
if (LRT_ABC(LCross) && is[LCross] > 0) {
|
||||
INTERSECT_JUST_GREATER(is, order, DBL_TRIANGLE_LIM, LCross);
|
||||
if (LRT_ABC(LCross) && is[LCross] > DBL_TRIANGLE_LIM) {
|
||||
INTERSECT_JUST_GREATER(is, order, is[LCross], RCross);
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user