Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-04 17:18:14 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-03-04 17:18:14 +0400
commit42ca1c8dcd8d148124b9d5fcf262887cac9909c1 (patch)
tree963f762d9a16a4fb4f60604efbda99258b6113e0 /source/blender/gpu/intern/gpu_material.c
parent7a1086d9a19152ec986e350a0db9a02398bd4761 (diff)
Fix for image transparency backwards compatibility. Now the texture datablock has
a Use Alpha option again. This makes the case where you enabled Premultiply on the image and disabled Use Alpha on the texture work again. That's mostly useful when you have a straight alpha image file which has no useful RGB colors in zero alpha regions (e.g. renders). Then sometimes you don't want to use the alpha for the texture stack mixing, but you still want to multiply it into the RGB channels to avoid a blocky transition into zero alpha regions. This also removes the version patch that copied image datablocks because it's not reliable and might be causing bug #34434. This does mean we are no longer backwards compatible for cases where two different texture datablocks with Use Alpha enabled and disabled where using the same image.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index d7ac6febfb7..636c44d3e80 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 = (tex->ima->flag & IMA_IGNORE_ALPHA) == 0;
+ talpha = ((tex->imaflag & TEX_USEALPHA) && tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0);
}
else {
continue;