From 8f9150871c5f41df948d523c51ed04fc689eaf07 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 27 Apr 2013 12:51:23 +0000 Subject: Fix part of #34233: bad alpha blending for 2D image painting. This is a very old issue, the formulas here were never quite right, should all work ok now with byte and float images. Some differences: * Colors with zero alpha from the background will never have an influence, so you don't get alpha fringes when painting over such areas. This does give hard edges when looking at the RGB channels alone, but there's no way to avoid that and fringes at the same time, same behavior as other painting apps. * Add/Subtract/Multiply/Lighten/Darken now leave the alpha channel unchanged and work only the RGB channels, again same behavior as many other apps. * Erase/Add alpha now compensates for premultiplied float images to keep the straight RGB colors the same. Next: fix projection painting. --- source/blender/blenlib/intern/math_base_inline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenlib/intern/math_base_inline.c') diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index f916460dec4..3ffd96f62c7 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -35,7 +35,7 @@ #include #include -#include "BLI_math.h" +#include "BLI_math_base.h" /* copied from BLI_utildefines.h */ #ifdef __GNUC__ -- cgit v1.2.3