diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-26 12:57:41 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-07-26 12:57:41 +0400 |
commit | 9c4380383cc1d4fcf9ea9e34c2163cb3d3353a3e (patch) | |
tree | 107f9458531a2f297ad3ff9be8b8289b5184e734 /source/blender/gpu/intern | |
parent | 5eea2832e9cf484e96bb439886eae44676660df1 (diff) |
Fix #32138: material trancpareny setting
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 557d8dbe237..bd25a042ee4 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -1348,6 +1348,7 @@ static void do_material_tex(GPUShadeInput *shi) void GPU_shadeinput_set(GPUMaterial *mat, Material *ma, GPUShadeInput *shi) { float hard = ma->har; + float one = 1.0f; memset(shi, 0, sizeof(*shi)); @@ -1357,7 +1358,12 @@ void GPU_shadeinput_set(GPUMaterial *mat, Material *ma, GPUShadeInput *shi) GPU_link(mat, "set_rgb", GPU_uniform(&ma->r), &shi->rgb); GPU_link(mat, "set_rgb", GPU_uniform(&ma->specr), &shi->specrgb); GPU_link(mat, "shade_norm", GPU_builtin(GPU_VIEW_NORMAL), &shi->vn); - GPU_link(mat, "set_value", GPU_uniform(&ma->alpha), &shi->alpha); + + if (ma->mode & MA_TRANSP) + GPU_link(mat, "set_value", GPU_uniform(&ma->alpha), &shi->alpha); + else + GPU_link(mat, "set_value", GPU_uniform(&one), &shi->alpha); + GPU_link(mat, "set_value", GPU_uniform(&ma->ref), &shi->refl); GPU_link(mat, "set_value", GPU_uniform(&ma->spec), &shi->spec); GPU_link(mat, "set_value", GPU_uniform(&ma->emit), &shi->emit); |