diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-13 16:17:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-13 16:17:15 +0300 |
commit | 4be8384e2798c2b3bc9fab4e04b7404bda152d5e (patch) | |
tree | e05dceb50ff16462b9d6081bc1c4874c3177a704 /source/blender/render | |
parent | b673f7318c9733f009acfae1b640ca14eec79047 (diff) |
Fix #20391: onlyshadow material doesn't render transparent shadows.
Fix #21033: AO + onlyshadow problem. Reverting to the old behavior which
I don't really understand, but at least it's compatible.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/intern/source/shadeoutput.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 2963e7ce99d..7ba6a889ffc 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -1527,7 +1527,7 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr) lamp_get_shadow(lar, shi, inpr, shadfac, shi->depth); ir+= 1.0f; - accum+= (1.0f-visifac) + (visifac)*shadfac[3]; + accum+= (1.0f-visifac) + (visifac)*rgb_to_grayscale(shadfac)*shadfac[3]; } } if(ir>0.0f) { @@ -1544,15 +1544,17 @@ static void shade_lamp_loop_only_shadow(ShadeInput *shi, ShadeResult *shr) if(R.wrld.mode & WO_AMB_OCC) { f= R.wrld.aoenergy*shi->amb; - if(R.wrld.aomix==WO_AOADD) - shr->alpha += f*(1.0f - rgb_to_grayscale(shi->ao)); + if(R.wrld.aomix==WO_AOADD) { + f= f*(1.0f - rgb_to_grayscale(shi->ao)); + shr->alpha= (shr->alpha + f)*f; + } else shr->alpha= (1.0f - f)*shr->alpha + f*(1.0f - (1.0f - shr->alpha)*rgb_to_grayscale(shi->ao)); } if(R.wrld.mode & WO_ENV_LIGHT) { - f= R.wrld.ao_env_energy*shi->amb; - shr->alpha += f*(1.0f - rgb_to_grayscale(shi->env)); + f= R.wrld.ao_env_energy*shi->amb*(1.0f - rgb_to_grayscale(shi->env)); + shr->alpha= (shr->alpha + f)*f; } } } |