diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-28 15:36:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-28 15:36:01 +0400 |
commit | 3ec212fd71ee5b8aed165d4361f0c9d0f7152b9e (patch) | |
tree | bc8b6511ecc33769d9b4a35248c436c335ee28ba /source/blender/blenkernel/intern | |
parent | f405d8fa5353cf0c839b44105048251fd4a1a481 (diff) |
patch [#32195] MASKS: Canonical Porter Duff algorithm for merge missing.
from Troy Sobotka (sobotka)
This gives nicer blending then 'ADD', setting as default for new masks.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mask_rasterize.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index df38cc9571f..a088a91000c 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -156,6 +156,7 @@ MaskLayer *BKE_mask_layer_new(Mask *mask, const char *name) mask->masklay_tot++; + masklay->blend = MASK_BLEND_MERGE; masklay->alpha = 1.0f; return masklay; diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index b05c1ad4eaa..da0070f0c09 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -1251,6 +1251,9 @@ float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float x } switch (layer->blend) { + case MASK_BLEND_MERGE: + value += value_layer * (1.0f - value); + break; case MASK_BLEND_ADD: value += value_layer; break; |