2.5: Material buttons
[blender.git] / source / blender / gpu / intern / gpu_material.c
index 7e8b5c18d71a295eca805ff53837ad3a7e8b299a..067f4d8021de2148ea2a0318022f51cc83877c26 100644 (file)
@@ -1139,7 +1139,7 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
 
        do_material_tex(shi);
 
-       if(ma->mode & MA_ZTRA)
+       if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))
                GPU_material_enable_alpha(mat);
 
        if((G.fileflags & G_FILE_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) {
@@ -1213,7 +1213,7 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr)
                        GPU_uniform(&world->horr), &shr->combined);
        }
 
-       if(!(ma->mode & MA_ZTRA)) {
+       if(!((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP))) {
                if(world && (GPU_link_changed(shr->alpha) || ma->alpha != 1.0f))
                        GPU_link(mat, "shade_world_mix", GPU_uniform(&world->horr),
                                shr->combined, &shr->combined);