diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-28 15:55:41 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-28 15:55:41 +0400 |
commit | fe6c45e36e4fae22bbddbf3e51c7d1fca03c3c1a (patch) | |
tree | 31233740f13c5d32fc9791234197a03bd60ad510 /source/blender/imbuf/IMB_imbuf.h | |
parent | 753fe9f0b970c83d253a79f4b12a13d3cc5f5fad (diff) |
Fix #34233: bad alpha blending for 3D texture painting. Same changes as the
previous fix for 2D image painting were done, and also:
* For brushes that do masking (keeping the max contribution to a pixel limited),
the alpha from textures is now part of the mask. In many cases the logic
worked out the same and where it didn't it used to cause artifacts.
* Color interpolation for smear and soften tools now happens in premultipied
space, to avoid bleeding of RGB colors from zero alpha areas.
* Fix a few cases where byte <=> float conversion was not doing the proper
straight <=> premul conversion.
* Replace some float division by constants with multiplications, is faster.
Note: float texture painting seems to have some issues updating the OpenGL
texture, but issue was already there before this commit.
Diffstat (limited to 'source/blender/imbuf/IMB_imbuf.h')
-rw-r--r-- | source/blender/imbuf/IMB_imbuf.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 5eb7e663fd6..04179b28e56 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -169,9 +169,9 @@ typedef enum IMB_BlendMode { IMB_BLEND_COPY_ALPHA = 1002 } IMB_BlendMode; -unsigned int IMB_blend_color(unsigned int src1, unsigned int src2, int fac, - IMB_BlendMode mode); -void IMB_blend_color_float(float dst[4], float src1[4], float src2[4], float fac, +void IMB_blend_color_byte(unsigned char dst[4], unsigned char src1[4], + unsigned char src2[4], IMB_BlendMode mode); +void IMB_blend_color_float(float dst[4], float src1[4], float src2[4], IMB_BlendMode mode); void IMB_rectclip(struct ImBuf *dbuf, struct ImBuf *sbuf, int *destx, |