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.
This commit is contained in:
2010-02-13 13:17:15 +00:00
parent b673f7318c
commit 4be8384e27

View File

@@ -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;
}
}
}