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:
authorYiming Wu <xp8110@outlook.com>2022-07-01 11:55:15 +0300
committerYiming Wu <xp8110@outlook.com>2022-07-01 15:46:17 +0300
commit56b218296c228acbe00940d50336a3b6f0df2915 (patch)
tree7c2fe82fdac8b60459a0b87d7cbd52ed3cc8b819 /source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
parentb683a37824aa2fb22efe22a1dbce667b8155698f (diff)
Fix T99268: LineArt better handling for dense overlappings.
Two main fixes: - Split tiles only when we are more sure that it will improve distribution. - Discard edges and chains that are not gonna be used afterwards before chaining. This speeds up the whole process and also eliminates unnecessary tile splitting. Reviewed By: Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D15335
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
index 988698771bf..7c8e0c5a6f5 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
@@ -725,8 +725,9 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartData *ld)
}
}
}
- /* Get rid of those very short "zig-zag" lines that jumps around visibility. */
- MOD_lineart_chain_discard_short(ld, DBL_EDGE_LIM);
+
+ MOD_lineart_chain_discard_unused(ld, DBL_EDGE_LIM, ld->conf.max_occlusion_level);
+
LISTBASE_FOREACH (LineartEdgeChain *, iec, &ld->chains) {
lineart_bounding_area_link_chain(ld, iec);
}
@@ -1018,12 +1019,14 @@ float MOD_lineart_chain_compute_length(LineartEdgeChain *ec)
return offset_accum;
}
-void MOD_lineart_chain_discard_short(LineartData *ld, const float threshold)
+void MOD_lineart_chain_discard_unused(LineartData *ld,
+ const float threshold,
+ uint8_t max_occlusion)
{
LineartEdgeChain *ec, *next_ec;
for (ec = ld->chains.first; ec; ec = next_ec) {
next_ec = ec->next;
- if (MOD_lineart_chain_compute_length(ec) < threshold) {
+ if (ec->level > max_occlusion || MOD_lineart_chain_compute_length(ec) < threshold) {
BLI_remlink(&ld->chains, ec);
}
}