[Bf-blender-cvs] [82f51fe9132] master: Fix T77356: Texture Preview not taking alpha into account

Philipp Oeser noreply at git.blender.org
Wed Jun 10 11:09:31 CEST 2020


Commit: 82f51fe9132f50d10f1263e97ecde9655af97671
Author: Philipp Oeser
Date:   Thu Jun 4 18:01:05 2020 +0200
Branches: master
https://developer.blender.org/rB82f51fe9132f50d10f1263e97ecde9655af97671

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

===================================================================

M	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;
     }



More information about the Bf-blender-cvs mailing list