diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-04 20:37:05 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-03-04 20:37:05 +0400 |
commit | 7891a926516b9aa21fa44e627d501f7a6da0443d (patch) | |
tree | d0a1de1ba89851558f2e6e74e0680a2ed792608d /source | |
parent | 9de5c35ce0c0b05fab133c339eba0deab313a7db (diff) |
Fix for texture preview render with show alpha enabled, now it shows no
transparency when use alpha and calculate alpha are disabled.
It's a bit arbitrary as it's not possible to fully visualize the output
of a texture, that depends on how it's used in the texture stack, but this
is a bit more in line with what you might expect.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/render/render_preview.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index dfc80e4cf51..3bf09cbbac1 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -425,15 +425,16 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre if (tex && sp->slot) mat->mtex[0]->which_output = sp->slot->which_output; - + + mat->mtex[0]->mapto &= ~MAP_ALPHA; + mat->alpha = 1.0f; + /* show alpha in this case */ if (tex == NULL || (tex->flag & TEX_PRV_ALPHA)) { - mat->mtex[0]->mapto |= MAP_ALPHA; - mat->alpha = 0.0f; - } - else { - mat->mtex[0]->mapto &= ~MAP_ALPHA; - mat->alpha = 1.0f; + if (!(tex && tex->type == TEX_IMAGE && (tex->imaflag & (TEX_USEALPHA|TEX_CALCALPHA)) == 0)) { + mat->mtex[0]->mapto |= MAP_ALPHA; + mat->alpha = 0.0f; + } } } } |