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
This commit is contained in:
Philipp Oeser 2020-06-04 18:01:05 +02:00
parent df50104e1c
commit 82f51fe913
Notes: blender-bot 2023-02-14 08:07:50 +01:00
Referenced by issue #77356, Texture with alpha channel doesn't preview correctly.
1 changed files with 1 additions and 1 deletions

View File

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