diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/imagetexture.c | 18 |
2 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 9731d7a6b3a..b5ef27a338d 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1035,7 +1035,7 @@ static void do_material_tex(GPUShadeInput *shi) GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser, FALSE), &tin, &trgb); rgbnor= TEX_RGB; - talpha= 1; + talpha = (tex->ima->flag & IMA_IGNORE_ALPHA) == 0; } else { continue; diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index 0a427d57ebc..55dadc14989 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -224,8 +224,10 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul } /* keep this before interpolation [#29761] */ - if ((tex->imaflag & TEX_CALCALPHA) == 0) { - texres->talpha = TRUE; + if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_CALCALPHA) == 0) { + texres->talpha = TRUE; + } } /* interpolate */ @@ -1092,8 +1094,10 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex /* mipmap test */ image_mipmap_test(tex, ibuf); - if ((tex->imaflag & TEX_CALCALPHA) == 0) - texres->talpha = 1; + if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_CALCALPHA) == 0) + texres->talpha = 1; + } texr.talpha = texres->talpha; if (tex->imaflag & TEX_IMAROT) { @@ -1506,8 +1510,10 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const /* mipmap test */ image_mipmap_test(tex, ibuf); - if ((tex->imaflag & TEX_CALCALPHA) == 0) { - texres->talpha = TRUE; + if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) { + if ((tex->imaflag & TEX_CALCALPHA) == 0) { + texres->talpha = TRUE; + } } texr.talpha= texres->talpha; |