Optimize for AO: when material ambient value is zero, no AO calculus

takes place now. Also nice to tweak & speedup environments.

(Thanks Theeth for hint!)
This commit is contained in:
Ton Roosendaal
2004-04-26 15:07:08 +00:00
parent 0facc2681e
commit 44f8257436

View File

@@ -1653,7 +1653,7 @@ static void ambient_occlusion(World *wrld, ShadeInput *shi, ShadeResult *shr)
{
float f, shadfac[4];
if((wrld->mode & WO_AMB_OCC) && (R.r.mode & R_RAYTRACE)) {
if((wrld->mode & WO_AMB_OCC) && (R.r.mode & R_RAYTRACE) && shi->matren->amb!=0.0) {
ray_ao(shi, wrld, shadfac);
if(wrld->aocolor==WO_AOPLAIN) {