From 100896e080bc6f09177fbf4aa6ad4b587bd95ed5 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 30 Mar 2020 18:18:37 +0200 Subject: GPencil: Rename Overlay blend mode to Hard Light Differential Revision: https://developer.blender.org/D7280 --- source/blender/draw/engines/gpencil/gpencil_cache_utils.c | 6 +++--- .../blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl | 8 ++++---- source/blender/makesdna/DNA_gpencil_types.h | 2 +- source/blender/makesrna/intern/rna_gpencil.c | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'source/blender') diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index a5f67b7831e..f8f55843a29 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -314,12 +314,12 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData *pd, break; case eGplBlendMode_Multiply: case eGplBlendMode_Divide: - case eGplBlendMode_Overlay: + case eGplBlendMode_HardLight: state |= DRW_STATE_BLEND_MUL; break; } - if (ELEM(gpl->blend_mode, eGplBlendMode_Subtract, eGplBlendMode_Overlay)) { + if (ELEM(gpl->blend_mode, eGplBlendMode_Subtract, eGplBlendMode_HardLight)) { /* For these effect to propagate, we need a signed floating point buffer. */ pd->use_signed_fb = true; } @@ -336,7 +336,7 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData *pd, DRW_shgroup_stencil_mask(grp, 0xFF); DRW_shgroup_call_procedural_triangles(grp, NULL, 1); - if (gpl->blend_mode == eGplBlendMode_Overlay) { + if (gpl->blend_mode == eGplBlendMode_HardLight) { /* We cannot do custom blending on MultiTarget framebuffers. * Workaround by doing 2 passes. */ grp = DRW_shgroup_create(sh, tgp_layer->blend_ps); diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl index 5155bfeab90..54b2369b32b 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl @@ -77,12 +77,12 @@ layout(std140) uniform gpLightBlock /* Must match eGPLayerBlendModes */ #define MODE_REGULAR 0 -#define MODE_OVERLAY 1 +#define MODE_HARDLIGHT 1 #define MODE_ADD 2 #define MODE_SUB 3 #define MODE_MULTIPLY 4 #define MODE_DIVIDE 5 -#define MODE_OVERLAY_SECOND_PASS 999 +#define MODE_HARDLIGHT_SECOND_PASS 999 void blend_mode_output( int blend_mode, vec4 color, float opacity, out vec4 frag_color, out vec4 frag_revealage) @@ -104,7 +104,7 @@ void blend_mode_output( color.a *= opacity; frag_revealage = frag_color = clamp(1.0 / max(vec4(1e-6), 1.0 - color * color.a), 0.0, 1e18); break; - case MODE_OVERLAY: + case MODE_HARDLIGHT: /* Reminder: Blending func is multiply blend (dst.rgba * src.rgba).*/ /** * We need to separate the overlay equation into 2 term (one mul and one add). @@ -122,7 +122,7 @@ void blend_mode_output( frag_revealage = frag_color = 2.0 * s + 2.0 * color * (1.0 - s * 2.0); frag_revealage = max(vec4(0.0), frag_revealage); break; - case MODE_OVERLAY_SECOND_PASS: + case MODE_HARDLIGHT_SECOND_PASS: /* Reminder: Blending func is additive blend (dst.rgba + src.rgba).*/ color = mix(vec4(0.5), color, color.a * opacity); frag_revealage = frag_color = (-1.0 + 2.0 * color) * step(-0.5, -color); diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index a90935bfe62..de66be3c1be 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -468,7 +468,7 @@ typedef enum eGPDlayer_OnionFlag { /* layer blend_mode */ typedef enum eGPLayerBlendModes { eGplBlendMode_Regular = 0, - eGplBlendMode_Overlay = 1, + eGplBlendMode_HardLight = 1, eGplBlendMode_Add = 2, eGplBlendMode_Subtract = 3, eGplBlendMode_Multiply = 4, diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index deacd8e1cfc..10a8f4cd9d2 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -114,7 +114,7 @@ static const EnumPropertyItem rna_enum_gplayer_move_type_items[] = { static const EnumPropertyItem rna_enum_layer_blend_modes_items[] = { {eGplBlendMode_Regular, "REGULAR", 0, "Regular", ""}, - {eGplBlendMode_Overlay, "OVERLAY", 0, "Overlay", ""}, + {eGplBlendMode_HardLight, "HARDLIGHT", 0, "Hard Light", ""}, {eGplBlendMode_Add, "ADD", 0, "Add", ""}, {eGplBlendMode_Subtract, "SUBTRACT", 0, "Subtract", ""}, {eGplBlendMode_Multiply, "MULTIPLY", 0, "Multiply", ""}, -- cgit v1.2.3