If Material has "Shadow" off, it didn't skip AO correctly. Effect was it
showed AO colors from other materials on same scanline.
This commit is contained in:
Ton Roosendaal 2006-12-11 19:20:10 +00:00
parent 675ab02726
commit b597093994

@ -1475,10 +1475,12 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
/* AO pass */
if(R.wrld.mode & WO_AMB_OCC) {
if(passflag & (SCE_PASS_COMBINED|SCE_PASS_AO)) {
/* AO was calculated for scanline already */
if(shi->depth)
ambient_occlusion(shi);
VECCOPY(shr->ao, shi->ao);
if(ma->mode & MA_SHADOW) {
/* AO was calculated for scanline already */
if(shi->depth)
ambient_occlusion(shi);
VECCOPY(shr->ao, shi->ao);
}
}
}
@ -1548,12 +1550,14 @@ void shade_lamp_loop(ShadeInput *shi, ShadeResult *shr)
/* add AO in combined? */
if(R.wrld.mode & WO_AMB_OCC) {
if(shi->combinedflag & SCE_PASS_AO) {
float aodiff[3];
ambient_occlusion_to_diffuse(shi, aodiff);
shr->combined[0] += shi->r*aodiff[0];
shr->combined[1] += shi->g*aodiff[1];
shr->combined[2] += shi->b*aodiff[2];
if(ma->mode & MA_SHADOW) {
float aodiff[3];
ambient_occlusion_to_diffuse(shi, aodiff);
shr->combined[0] += shi->r*aodiff[0];
shr->combined[1] += shi->g*aodiff[1];
shr->combined[2] += shi->b*aodiff[2];
}
}
}