diff options
author | YimingWu <xp8110@outlook.com> | 2021-09-26 14:43:12 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2021-09-26 14:43:12 +0300 |
commit | 80f7bc6d8e7e7a5e543df5418313c04df5140c43 (patch) | |
tree | 5dc395993dd4761e3bf9282e5e3a0fadb5ae2806 /source/blender/makesdna | |
parent | 505422220d6e172fddc8a40fabee47f5d35e0c7d (diff) |
LineArt: Smooth tolerance value for chaining.
smooth out jaggy lines with a given threshold. For each point in a stroke, the ones with in a given distance of its previous segment will be removed,
thus "zig-zag" artefacts can be cleaned up.
Reviewed By: Antonio Vazquez (antoniov)
Differential Revision: https://developer.blender.org/D12050
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_defaults.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_modifier_types.h | 6 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_types.h | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h index 2a3c6f4e3db..11299ae9717 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_defaults.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_defaults.h @@ -318,7 +318,7 @@ .calculation_flags = LRT_ALLOW_DUPLI_OBJECTS | LRT_ALLOW_CLIPPING_BOUNDARIES | LRT_USE_CREASE_ON_SHARP_EDGES, \ .angle_splitting_threshold = DEG2RAD(60.0f), \ .chaining_image_threshold = 0.001f, \ - .overscan = 0.1f,\ + .chain_smooth_tolerance = 0.2f,\ } #define _DNA_DEFAULT_LengthGpencilModifierData \ diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 8d967a38808..ea5c81761c6 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -1040,7 +1040,11 @@ typedef struct LineartGpencilModifierData { /** `0..PI` angle, for splitting strokes at sharp points. */ float angle_splitting_threshold; - /* Doubles as geometry threshold when geometry space chaining is enabled */ + /** Strength for smoothing jagged chains. */ + float chain_smooth_tolerance; + int _pad1; + + /* CPU mode */ float chaining_image_threshold; /* Ported from SceneLineArt flags. */ diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 68bd2961f23..0f570f8603d 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -49,6 +49,8 @@ struct MDeformVert; #define GPENCIL_MIN_FILL_FAC 0.05f #define GPENCIL_MAX_FILL_FAC 8.0f +#define GPENCIL_MAX_THICKNESS 5000 + /* ***************************************** */ /* GP Stroke Points */ |