diff options
author | Daniel Stokes <kupomail@gmail.com> | 2013-07-20 03:00:42 +0400 |
---|---|---|
committer | Daniel Stokes <kupomail@gmail.com> | 2013-07-20 03:00:42 +0400 |
commit | 017f09b9d467c12d6a7fd3cb744ca0eb4e851d0e (patch) | |
tree | 8e99b9c107fa76fa38332a0f1696f5b84d32b80c /source/blender/gpu | |
parent | 51a3371d87c3a640a3d3329c043d114acb364bcb (diff) |
BGE fix [#35195] Shadow Only lamps only work with Specular enabled
The way we do shadow only doesn't work well with colored shadows, though it does work if you apply enough light to the shadow.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 044b699a042..0ca929da65d 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -742,12 +742,16 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la } if (lamp->mode & LA_ONLYSHADOW) { + GPUNodeLink *rgb; GPU_link(mat, "shade_only_shadow", i, shadfac, GPU_dynamic_uniform(&lamp->dynenergy, GPU_DYNAMIC_LAMP_DYNENERGY, lamp->ob), &shadfac); + + GPU_link(mat, "shade_mul", shi->rgb, GPU_uniform(lamp->shadow_color), &rgb); + GPU_link(mat, "mtex_rgb_invert", rgb, &rgb); if (!(lamp->mode & LA_NO_DIFF)) { - GPU_link(mat, "mix_mult", shadfac, shr->diff, - GPU_uniform(lamp->shadow_color), &shr->diff); + GPU_link(mat, "shade_only_shadow_diffuse", shadfac, rgb, + shr->diff, &shr->diff); } if (!(lamp->mode & LA_NO_SPEC)) |