diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-08-12 15:49:27 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-08-12 15:49:45 +0400 |
commit | ba345bcbb6de5f32ba8ae3e9666077c707d10764 (patch) | |
tree | 3732eee5bcf15bbca42f82d9facb8e58c552b3ee /source/blender/imbuf/intern/divers.c | |
parent | 794277f8b6ca5f48eb994560d201e210e1eabaf1 (diff) |
Fix T41414, T41386.
There were a few issues to fix here:
* We did not really unpremultiply float image dabs prior to sending them
to the GPU. That made float and byte image result different in texture
painting and undoing could change the result.
* To make textures nicely composited over the mesh, I used decal mode in
OpenGL texture environment for the texture unit. This uses the texture's
alpha channel with a nice over operator.
* Texture creation used to override the alpha setting due to the display
restrictions. Not so anymore, people can now create transparent byte
images.
Also, made alpha zero default for new textures now, since it has such a
nice effect here.
Diffstat (limited to 'source/blender/imbuf/intern/divers.c')
-rw-r--r-- | source/blender/imbuf/intern/divers.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 9975c58bdd2..03cd5ecd646 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -720,6 +720,7 @@ void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w ibuf->channels, IB_PROFILE_SRGB, profile_from, true, w, h, w, ibuf->x); + IMB_buffer_float_unpremultiply(buffer, w, h); /* XXX: need to convert to image buffer's rect space */ IMB_buffer_byte_from_float(rect_byte, buffer, 4, ibuf->dither, IB_PROFILE_SRGB, IB_PROFILE_SRGB, 0, |