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>2008-09-05 19:08:01 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-09-05 19:08:01 +0400
commit2e653838c09be5f813c4d979a035b0b44211bed4 (patch)
tree1e5d47ea1a978a25c5084d5428d8879e1dfc2145 /source/blender/gpu/intern/gpu_material.c
parentf1415bca7e9448076b2a3454b964b139b4a2e510 (diff)
Bugfix for GLSL: no specular/diffuse + only shadow for lamps
didn't work correct.
Diffstat (limited to 'source/blender/gpu/intern/gpu_material.c')
-rw-r--r--source/blender/gpu/intern/gpu_material.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 4e54ca77ec4..1bbf21488ea 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -682,8 +682,15 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la
if(lamp->mode & LA_ONLYSHADOW) {
GPU_link(mat, "shade_only_shadow", i, shadfac,
- GPU_dynamic_uniform(&lamp->dynenergy), shi->rgb, shi->specrgb,
- shr->diff, shr->spec, &shr->diff, &shr->spec);
+ GPU_dynamic_uniform(&lamp->dynenergy), &shadfac);
+
+ if(!(lamp->mode & LA_NO_DIFF))
+ GPU_link(mat, "shade_only_shadow_diffuse", shadfac, shi->rgb,
+ shr->diff, &shr->diff);
+
+ if(!(lamp->mode & LA_NO_SPEC))
+ GPU_link(mat, "shade_only_shadow_specular", shadfac, shi->specrgb,
+ shr->spec, &shr->spec);
add_user_list(&mat->lamps, lamp);
add_user_list(&lamp->materials, ma);