--- ray/src/rt/ambient.c 2014/04/23 06:04:18 2.76 +++ ray/src/rt/ambient.c 2014/04/24 19:16:52 2.78 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: ambient.c,v 2.76 2014/04/23 06:04:18 greg Exp $"; +static const char RCSid[] = "$Id: ambient.c,v 2.78 2014/04/24 19:16:52 greg Exp $"; #endif /* * ambient.c - routines dealing with ambient (inter-reflected) component. @@ -152,7 +152,7 @@ setambient(void) /* initialize calculation */ ambdone(); /* init ambient limits */ setambres(ambres); - setambacc(ambacc); + qambacc = sqrt(sqrt(ambacc *= (ambacc > FTINY))); if (ambfile == NULL || !ambfile[0]) return; if (ambacc <= FTINY) { @@ -406,7 +406,7 @@ sumambient( /* get interpolated ambient value */ d = 0.0; for (j = 0; j < 3; j++) d += (r->rop[j] - av->pos[j])*(uvw[2][j] + r->ron[j]); - if (d*0.5 < -minarad*ambacc-.001) + if (d*0.5 < -minarad*qambacc-.001) continue; /* * Extrapolate value and compute final weight (hat function)