From b17cca6966dd06be5fc66a5c1ece79bbfe6b39b7 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 22 Sep 2020 13:52:38 +0200 Subject: Fix T81026: Image Editor: Alpha (like Bloom) not showing properly With the new image editor drawing there were was some mutual exclusive functionality. When rendering the alpha was shown correctly or the pure emissive colors were shown correctly, but never both. The cause of this is that the image_gpu did not used the correct alpha mode when generating gpu textures for non-images (render results, compositors viewer) The implementation always checked the alpha_mode. Alpha mode is an attribute for images, but aren't set for non images. This patch adds a more detailed check to ensure that the gpu texture is premultiplied. The issue has been tested using several bug report files and production files. Reviewed By: Brecht van Lommel Differential Revision: https://developer.blender.org/D8978 --- source/blender/draw/engines/image/image_engine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/draw') diff --git a/source/blender/draw/engines/image/image_engine.c b/source/blender/draw/engines/image/image_engine.c index 2f380619c2c..3d767f911fa 100644 --- a/source/blender/draw/engines/image/image_engine.c +++ b/source/blender/draw/engines/image/image_engine.c @@ -138,7 +138,7 @@ static void image_cache_image(IMAGE_Data *vedata, Image *image, ImageUser *iuser far_near[0] = ((Camera *)scene->camera->data)->clip_end; } - const bool use_premul_alpha = image->alpha_mode == IMA_ALPHA_PREMUL; + const bool use_premul_alpha = BKE_image_has_gpu_texture_premultiplied_alpha(image, ibuf); const bool is_tiled_texture = tex_tile_data != NULL; const bool do_repeat = (!is_tiled_texture) && ((sima->flag & SI_DRAW_TILE) != 0); -- cgit v1.2.3