LineArt: Fix transparency flag error during cutting and chaining.
This commit is contained in:
parent
7f769567d0
commit
0bae3002cf
|
@ -128,6 +128,7 @@ static LineartLineChainItem *lineart_chain_append_point(LineartRenderBuffer *rb,
|
|||
LineartLineChainItem *old_rlci = rlc->chain.last;
|
||||
old_rlci->line_type = type;
|
||||
old_rlci->occlusion = level;
|
||||
old_rlci->transparency_mask = transparency_mask;
|
||||
return old_rlci;
|
||||
}
|
||||
|
||||
|
@ -356,6 +357,7 @@ void MOD_lineart_chain_feature_lines(LineartRenderBuffer *rb)
|
|||
rls->transparency_mask,
|
||||
rl->l_obindex);
|
||||
last_occlusion = rls->occlusion;
|
||||
last_transparency = rls->transparency_mask;
|
||||
}
|
||||
VERT_COORD_TO_FLOAT(rl->r)
|
||||
lineart_chain_append_point(rb,
|
||||
|
@ -399,6 +401,7 @@ void MOD_lineart_chain_feature_lines(LineartRenderBuffer *rb)
|
|||
last_transparency = rls->transparency_mask;
|
||||
/* Fix leading vertex occlusion. */
|
||||
rlci->occlusion = last_occlusion;
|
||||
rlci->transparency_mask = last_transparency;
|
||||
for (rls = new_rl->segments.last; rls; rls = rls->prev) {
|
||||
double gpos[3], lpos[3];
|
||||
double *lfb = new_rl->l->fbcoord, *rfb = new_rl->r->fbcoord;
|
||||
|
@ -406,6 +409,7 @@ void MOD_lineart_chain_feature_lines(LineartRenderBuffer *rb)
|
|||
interp_v3_v3v3_db(lpos, new_rl->l->fbcoord, new_rl->r->fbcoord, rls->at);
|
||||
interp_v3_v3v3_db(gpos, new_rl->l->gloc, new_rl->r->gloc, global_at);
|
||||
last_occlusion = rls->prev ? rls->prev->occlusion : last_occlusion;
|
||||
last_transparency = rls->prev ? rls->prev->transparency_mask : last_transparency;
|
||||
POS_TO_FLOAT(lpos, gpos)
|
||||
lineart_chain_append_point(rb,
|
||||
rlc,
|
||||
|
@ -423,6 +427,7 @@ void MOD_lineart_chain_feature_lines(LineartRenderBuffer *rb)
|
|||
last_occlusion = rls->occlusion;
|
||||
last_transparency = rls->transparency_mask;
|
||||
rlci->occlusion = last_occlusion;
|
||||
rlci->transparency_mask = last_transparency;
|
||||
rls = rls->next;
|
||||
for (; rls; rls = rls->next) {
|
||||
double gpos[3], lpos[3];
|
||||
|
@ -595,6 +600,7 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb)
|
|||
/* Set the same occlusion level for the end vertex, so when further connection is needed
|
||||
* the backwards occlusion info is also correct. */
|
||||
rlci->occlusion = fixed_occ;
|
||||
rlci->transparency_mask = fixed_mask;
|
||||
/* No need to split at the last point anyway. */
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -260,18 +260,24 @@ static void lineart_line_cut(LineartRenderBuffer *rb,
|
|||
else {
|
||||
/* We have yet to reach a existing cutting point even after we searched the whole line, so we
|
||||
* append the new cut to the end. */
|
||||
ns->occlusion = (irls = rl->segments.last)->occlusion;
|
||||
irls = rl->segments.last;
|
||||
ns->occlusion = irls->occlusion;
|
||||
ns->transparency_mask = irls->transparency_mask;
|
||||
BLI_addtail(&rl->segments, ns);
|
||||
}
|
||||
if (cut_end_before) {
|
||||
/* The same manipulation as on "cut_start_before". */
|
||||
if (cut_end_before != ns2) {
|
||||
ns2->occlusion = cut_end_before->prev ? (irls = cut_end_before->prev)->occlusion : 0;
|
||||
irls = cut_end_before->prev ? cut_end_before->prev : NULL;
|
||||
ns2->occlusion = irls ? irls->occlusion : 0;
|
||||
ns2->transparency_mask = irls ? irls->transparency_mask : 0;
|
||||
BLI_insertlinkbefore(&rl->segments, (void *)cut_end_before, (void *)ns2);
|
||||
}
|
||||
}
|
||||
else {
|
||||
ns2->occlusion = (irls = rl->segments.last)->occlusion;
|
||||
irls = rl->segments.last;
|
||||
ns2->occlusion = irls->occlusion;
|
||||
ns2->transparency_mask = irls->transparency_mask;
|
||||
BLI_addtail(&rl->segments, ns2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue