From 29f3af95272590d26f610ae828b2eeee89c82a00 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 9 Mar 2020 16:27:24 +0100 Subject: GPencil: Refactor of Draw Engine, Vertex Paint and all internal functions This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes. Also, a huge code cleanup has been done at all levels. Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development. Differential Revision: https://developer.blender.org/D6293 --- source/blender/shader_fx/intern/FX_shader_blur.c | 9 +++++---- source/blender/shader_fx/intern/FX_shader_flip.c | 2 +- source/blender/shader_fx/intern/FX_shader_glow.c | 8 ++++---- source/blender/shader_fx/intern/FX_shader_pixel.c | 2 +- source/blender/shader_fx/intern/FX_shader_rim.c | 2 +- source/blender/shader_fx/intern/FX_shader_shadow.c | 2 +- source/blender/shader_fx/intern/FX_shader_util.c | 1 - source/blender/shader_fx/intern/FX_shader_wave.c | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) (limited to 'source/blender/shader_fx/intern') diff --git a/source/blender/shader_fx/intern/FX_shader_blur.c b/source/blender/shader_fx/intern/FX_shader_blur.c index 72d2a61dafd..e98205897aa 100644 --- a/source/blender/shader_fx/intern/FX_shader_blur.c +++ b/source/blender/shader_fx/intern/FX_shader_blur.c @@ -23,6 +23,7 @@ #include +#include "BLI_math.h" #include "BLI_utildefines.h" #include "FX_shader_types.h" @@ -30,9 +31,9 @@ static void initData(ShaderFxData *fx) { BlurShaderFxData *gpfx = (BlurShaderFxData *)fx; - ARRAY_SET_ITEMS(gpfx->radius, 1, 1); - gpfx->samples = 4; - gpfx->coc = 0.025f; + copy_v2_fl(gpfx->radius, 50.0f); + gpfx->samples = 8; + gpfx->rotation = 0.0f; } static void copyData(const ShaderFxData *md, ShaderFxData *target) @@ -45,7 +46,7 @@ ShaderFxTypeInfo shaderfx_Type_Blur = { /* structName */ "BlurShaderFxData", /* structSize */ sizeof(BlurShaderFxData), /* type */ eShaderFxType_GpencilType, - /* flags */ eShaderFxTypeFlag_Single, + /* flags */ 0, /* copyData */ copyData, diff --git a/source/blender/shader_fx/intern/FX_shader_flip.c b/source/blender/shader_fx/intern/FX_shader_flip.c index 804b194ed68..41ca903ee08 100644 --- a/source/blender/shader_fx/intern/FX_shader_flip.c +++ b/source/blender/shader_fx/intern/FX_shader_flip.c @@ -47,7 +47,7 @@ ShaderFxTypeInfo shaderfx_Type_Flip = { /* structName */ "FlipShaderFxData", /* structSize */ sizeof(FlipShaderFxData), /* type */ eShaderFxType_GpencilType, - /* flags */ eShaderFxTypeFlag_Single, + /* flags */ 0, /* copyData */ copyData, diff --git a/source/blender/shader_fx/intern/FX_shader_glow.c b/source/blender/shader_fx/intern/FX_shader_glow.c index 1b1e4dc9d94..8924a1ab8b9 100644 --- a/source/blender/shader_fx/intern/FX_shader_glow.c +++ b/source/blender/shader_fx/intern/FX_shader_glow.c @@ -27,6 +27,7 @@ #include "DNA_object_types.h" #include "DNA_gpencil_types.h" +#include "BLI_math.h" #include "BLI_utildefines.h" #include "BKE_modifier.h" @@ -37,12 +38,11 @@ static void initData(ShaderFxData *md) { GlowShaderFxData *gpfx = (GlowShaderFxData *)md; - ARRAY_SET_ITEMS(gpfx->glow_color, 0.75f, 1.0f, 1.0f); + ARRAY_SET_ITEMS(gpfx->glow_color, 0.75f, 1.0f, 1.0f, 1.0f); ARRAY_SET_ITEMS(gpfx->select_color, 0.0f, 0.0f, 0.0f); + copy_v2_fl(gpfx->blur, 50.0f); gpfx->threshold = 0.1f; - - ARRAY_SET_ITEMS(gpfx->blur, 50, 0); - gpfx->samples = 16; + gpfx->samples = 8; } static void copyData(const ShaderFxData *md, ShaderFxData *target) diff --git a/source/blender/shader_fx/intern/FX_shader_pixel.c b/source/blender/shader_fx/intern/FX_shader_pixel.c index e0ea111d121..f39649bba07 100644 --- a/source/blender/shader_fx/intern/FX_shader_pixel.c +++ b/source/blender/shader_fx/intern/FX_shader_pixel.c @@ -44,7 +44,7 @@ ShaderFxTypeInfo shaderfx_Type_Pixel = { /* structName */ "PixelShaderFxData", /* structSize */ sizeof(PixelShaderFxData), /* type */ eShaderFxType_GpencilType, - /* flags */ eShaderFxTypeFlag_Single, + /* flags */ 0, /* copyData */ copyData, diff --git a/source/blender/shader_fx/intern/FX_shader_rim.c b/source/blender/shader_fx/intern/FX_shader_rim.c index d16210918fc..a81d2ff2a09 100644 --- a/source/blender/shader_fx/intern/FX_shader_rim.c +++ b/source/blender/shader_fx/intern/FX_shader_rim.c @@ -35,7 +35,7 @@ static void initData(ShaderFxData *fx) ARRAY_SET_ITEMS(gpfx->offset, 50, -100); ARRAY_SET_ITEMS(gpfx->rim_rgb, 1.0f, 1.0f, 0.5f); ARRAY_SET_ITEMS(gpfx->mask_rgb, 0.0f, 0.0f, 0.0f); - gpfx->mode = eShaderFxRimMode_Multiply; + gpfx->mode = eShaderFxRimMode_Overlay; ARRAY_SET_ITEMS(gpfx->blur, 0, 0); gpfx->samples = 2; diff --git a/source/blender/shader_fx/intern/FX_shader_shadow.c b/source/blender/shader_fx/intern/FX_shader_shadow.c index 0ee45a0bd51..aa9da5ae9f1 100644 --- a/source/blender/shader_fx/intern/FX_shader_shadow.c +++ b/source/blender/shader_fx/intern/FX_shader_shadow.c @@ -44,7 +44,7 @@ static void initData(ShaderFxData *md) gpfx->rotation = 0.0f; ARRAY_SET_ITEMS(gpfx->offset, 15, 20); ARRAY_SET_ITEMS(gpfx->scale, 1.0f, 1.0f); - ARRAY_SET_ITEMS(gpfx->shadow_rgba, 0.54f, 0.62f, 1.0f, 0.9f); + ARRAY_SET_ITEMS(gpfx->shadow_rgba, 0.0f, 0.0f, 0.0f, 0.8f); gpfx->amplitude = 10.0f; gpfx->period = 20.0f; diff --git a/source/blender/shader_fx/intern/FX_shader_util.c b/source/blender/shader_fx/intern/FX_shader_util.c index 908a2b249b8..c2dcae04b85 100644 --- a/source/blender/shader_fx/intern/FX_shader_util.c +++ b/source/blender/shader_fx/intern/FX_shader_util.c @@ -39,7 +39,6 @@ void shaderfx_type_init(ShaderFxTypeInfo *types[]) INIT_FX_TYPE(Colorize); INIT_FX_TYPE(Flip); INIT_FX_TYPE(Glow); - INIT_FX_TYPE(Light); INIT_FX_TYPE(Pixel); INIT_FX_TYPE(Rim); INIT_FX_TYPE(Shadow); diff --git a/source/blender/shader_fx/intern/FX_shader_wave.c b/source/blender/shader_fx/intern/FX_shader_wave.c index 334024bbd3f..35d2e515f76 100644 --- a/source/blender/shader_fx/intern/FX_shader_wave.c +++ b/source/blender/shader_fx/intern/FX_shader_wave.c @@ -50,7 +50,7 @@ ShaderFxTypeInfo shaderfx_Type_Wave = { /* structName */ "WaveShaderFxData", /* structSize */ sizeof(WaveShaderFxData), /* type */ eShaderFxType_GpencilType, - /* flags */ eShaderFxTypeFlag_Single, + /* flags */ 0, /* copyData */ copyData, -- cgit v1.2.3