diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-02 18:01:45 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-05-02 18:01:45 +0400 |
commit | 14d7d480dfeef8a016a587d616691ede245781c9 (patch) | |
tree | 117b8781144702552ba1388cd96f4bedc3b43071 /source/blender/gpu/intern/gpu_material.c | |
parent | 7f4b4bbaf0ed5fc7ad41bca13f6a5f9f4d16220c (diff) |
Fix #26807: glsl diffuse/specular was not clamping negative values, giving
some inconsistent results with the renderer.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 962c486c159..1bf70fbd38b 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -557,7 +557,7 @@ static void add_to_diffuse(GPUMaterial *mat, Material *ma, GPUShadeInput *shi, G addcol = shi->rgb; /* output to */ - GPU_link(mat, "shade_madd", *diff, rgb, addcol, diff); + GPU_link(mat, "shade_madd_clamped", *diff, rgb, addcol, diff); } static void ramp_spec_result(GPUShadeInput *shi, GPUNodeLink **spec) @@ -730,7 +730,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la if(lamp->type == LA_HEMI) { GPU_link(mat, "shade_hemi_spec", vn, lv, view, GPU_uniform(&ma->spec), shi->har, visifac, &t); GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol), shi->specrgb, &outcol); - GPU_link(mat, "shade_add", shr->spec, outcol, &shr->spec); + GPU_link(mat, "shade_add_clamped", shr->spec, outcol, &shr->spec); } else { if(ma->spec_shader==MA_SPEC_PHONG) @@ -753,11 +753,11 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la GPUNodeLink *spec; do_specular_ramp(shi, specfac, t, &spec); GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol), spec, &outcol); - GPU_link(mat, "shade_add", shr->spec, outcol, &shr->spec); + GPU_link(mat, "shade_add_clamped", shr->spec, outcol, &shr->spec); } else { GPU_link(mat, "shade_add_spec", t, GPU_dynamic_uniform(lamp->dyncol), shi->specrgb, &outcol); - GPU_link(mat, "shade_add", shr->spec, outcol, &shr->spec); + GPU_link(mat, "shade_add_clamped", shr->spec, outcol, &shr->spec); } } } |