From 82f51fe9132f50d10f1263e97ecde9655af97671 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 4 Jun 2020 18:01:05 +0200 Subject: Fix T77356: Texture Preview not taking alpha into account Since rB329b4c3363e4 a texture preview is not rendered through the preview.blend and a renderengine anymore [unlike materials etc.] Alpha wasnt handled in that commit, take that into account now. sidenote: not sure if we should be looking into drawing alpha with a checkerboard in the background for texture previews (see texture previews elsewhere)? sidenote 2: might also be good to document where the "calculate" and "invert" alpha options are still used? [looks a bit inconsistent: compositor uses it, Image Editor as well as Render Engines dont?] Maniphest Tasks: T77356 Differential Revision: https://developer.blender.org/D7929 --- source/blender/editors/render/render_preview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/render/render_preview.c') diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 0432057bb47..19e4f652963 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -801,7 +801,7 @@ static void shader_preview_texture(ShaderPreview *sp, Tex *tex, Scene *sce, Rend rect_float[0] = texres.tr; rect_float[1] = texres.tg; rect_float[2] = texres.tb; - rect_float[3] = 1.0f; + rect_float[3] = texres.talpha ? texres.ta : 1.0f; rect_float += 4; } -- cgit v1.2.3