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-11-17 09:30:08 +0300
committerYimingWu <xp8110@outlook.com>2021-11-17 09:30:08 +0300
commit473be239c3c3669643853d549f06723d40b941bb (patch)
tree4eeef93d0584019ba45543050131a915a30bfe79 /source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
parente3c974b7e4ff726c016f9bfddaa44539ae41049f (diff)
LineArt: Improve certain edge cases in occlusion
This patch includes: View vector fix for ortho back face. Point on segment logic correction. Better handling of boundary cases. See review page for detailed description. Reviewed By: Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D13143
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c')
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
index f3110cf87b6..88dcfb89c25 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_chain.c
@@ -634,6 +634,8 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartRenderBuffer *rb)
}
}
}
+ /* Get rid of those very short "zig-zag" lines that jumps around visibility. */
+ MOD_lineart_chain_discard_short(rb, DBL_EDGE_LIM);
LISTBASE_FOREACH (LineartEdgeChain *, iec, &rb->chains) {
lineart_bounding_area_link_chain(rb, iec);
}
@@ -890,6 +892,9 @@ float MOD_lineart_chain_compute_length(LineartEdgeChain *ec)
float last_point[2];
eci = ec->chain.first;
+ if (!eci) {
+ return 0;
+ }
copy_v2_v2(last_point, eci->pos);
for (eci = ec->chain.first; eci; eci = eci->next) {
dist = len_v2v2(eci->pos, last_point);