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:
authorCampbell Barton <ideasman42@gmail.com>2011-10-09 11:31:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-09 11:31:15 +0400
commitaa6d7ebd145ff375a9dc876d33065f80d94accca (patch)
tree4c9562c2575294c94bd55cb4b3bd25a9e7e793b6 /source/blender/gpu
parent9d0186fc6a5aa0aab36b9a1f52e3cd5e1ac46767 (diff)
parent8714fb7019e853703ce8b102edac43d84b7bbe14 (diff)
svn merge ^/trunk/blender -r40720:40872
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/intern/gpu_draw.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 120c203e7bd..c5d62559056 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -1136,6 +1136,9 @@ int GPU_enable_material(int nr, void *attribs)
GMS.lastretval = !GMS.lastretval;
if(GMS.lastretval) {
+ /* for alpha pass, use alpha blend */
+ alphablend = (GMS.alphapass)? GPU_BLEND_ALPHA: GPU_BLEND_SOLID;
+
if(gattribs && GMS.gmatbuf[nr]) {
/* bind glsl material and get attributes */
Material *mat = GMS.gmatbuf[nr];
@@ -1145,7 +1148,11 @@ int GPU_enable_material(int nr, void *attribs)
GPU_material_bind(gpumat, GMS.gob->lay, GMS.glay, 1.0, !(GMS.gob->mode & OB_MODE_TEXTURE_PAINT));
GPU_material_bind_uniforms(gpumat, GMS.gob->obmat, GMS.gviewmat, GMS.gviewinv, GMS.gob->col);
GMS.gboundmat= mat;
- alphablend= mat->game.alpha_blend;
+
+ /* for glsl use alpha blend mode, unless it's set to solid and
+ we are already drawing in an alpha pass */
+ if(mat->game.alpha_blend != GPU_BLEND_SOLID)
+ alphablend= mat->game.alpha_blend;
if(GMS.alphapass) glDepthMask(1);
}
@@ -1154,11 +1161,9 @@ int GPU_enable_material(int nr, void *attribs)
glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, GMS.matbuf[nr].diff);
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, GMS.matbuf[nr].spec);
glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, GMS.matbuf[nr].hard);
- alphablend= GPU_BLEND_SOLID;
}
/* set (alpha) blending mode */
- if(!GMS.alphapass) alphablend= GPU_BLEND_SOLID;
GPU_set_material_alpha_blend(alphablend);
}