125 |
|
} |
126 |
|
} |
127 |
|
#if SHADCACHE |
128 |
< |
source[ns].obscache = NULL; |
128 |
> |
initobscache(ns); |
129 |
|
#endif |
130 |
|
if (!(source[ns].sflags & SSKIP)) |
131 |
|
foundsource++; |
499 |
|
if (!srcray(&sr, NULL, &si) || |
500 |
|
sr.rsrc != r->slights[i]) |
501 |
|
continue; /* no path */ |
502 |
+ |
#if SHADCACHE |
503 |
+ |
if (srcblocked(&sr)) /* check shadow cache */ |
504 |
+ |
continue; |
505 |
+ |
#endif |
506 |
|
copycolor(sr.cext, r->cext); |
507 |
|
copycolor(sr.albedo, r->albedo); |
508 |
|
sr.gecc = r->gecc; |
509 |
|
sr.slights = r->slights; |
510 |
|
rayvalue(&sr); /* eval. source ray */ |
511 |
< |
if (bright(sr.rcol) <= FTINY) |
511 |
> |
if (bright(sr.rcol) <= FTINY) { |
512 |
> |
#if SHADCACHE |
513 |
> |
srcblocker(&sr); /* add blocker to cache */ |
514 |
> |
#endif |
515 |
|
continue; |
516 |
+ |
} |
517 |
|
if (r->gecc <= FTINY) /* compute P(theta) */ |
518 |
|
d = 1.; |
519 |
|
else { |