--- ray/src/rt/source.c 2004/03/30 16:13:01 2.44 +++ ray/src/rt/source.c 2004/06/23 12:58:02 2.45 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: source.c,v 2.44 2004/03/30 16:13:01 schorsch Exp $"; +static const char RCSid[] = "$Id: source.c,v 2.45 2004/06/23 12:58:02 greg Exp $"; #endif /* * source.c - routines dealing with illumination sources. @@ -499,13 +499,21 @@ srcscatter( /* compute source scattering into ray */ if (!srcray(&sr, NULL, &si) || sr.rsrc != r->slights[i]) continue; /* no path */ +#if SHADCACHE + if (srcblocked(&sr)) /* check shadow cache */ + continue; +#endif copycolor(sr.cext, r->cext); copycolor(sr.albedo, r->albedo); sr.gecc = r->gecc; sr.slights = r->slights; rayvalue(&sr); /* eval. source ray */ - if (bright(sr.rcol) <= FTINY) + if (bright(sr.rcol) <= FTINY) { +#if SHADCACHE + srcblocker(&sr); /* add blocker to cache */ +#endif continue; + } if (r->gecc <= FTINY) /* compute P(theta) */ d = 1.; else {