| 177 |
|
double d; /* distance to source */ |
| 178 |
|
register SRCREC *srcp; |
| 179 |
|
|
| 180 |
< |
rayorigin(sr, r, SHADOW, 1.0); /* ignore limits */ |
| 180 |
> |
rayorigin(sr, SHADOW, r, NULL); /* ignore limits */ |
| 181 |
|
|
| 182 |
|
while ((d = nextssamp(sr, si)) != 0.0) { |
| 183 |
|
sr->rsrc = si->sn; /* remember source */ |
| 393 |
|
} |
| 394 |
|
#endif |
| 395 |
|
VCOPY(scp->dir, sr.rdir); |
| 396 |
+ |
copycolor(sr.rcoef, scp->coef); |
| 397 |
|
/* compute potential */ |
| 398 |
|
srcvalue(&sr); |
| 399 |
+ |
multcolor(sr.rcol, sr.rcoef); |
| 400 |
|
copycolor(scp->val, sr.rcol); |
| 399 |
– |
multcolor(scp->val, scp->coef); |
| 401 |
|
cntord[sn].brt = bright(scp->val); |
| 402 |
|
} |
| 403 |
|
/* sort contributions */ |
| 436 |
|
break; |
| 437 |
|
scp = srccnt + cntord[sn].sndx; |
| 438 |
|
/* test for hit */ |
| 439 |
< |
rayorigin(&sr, r, SHADOW, 1.0); |
| 439 |
> |
rayorigin(&sr, SHADOW, r, NULL); |
| 440 |
|
VCOPY(sr.rdir, scp->dir); |
| 441 |
|
sr.rsrc = scp->sno; |
| 442 |
|
/* keep statistics */ |
| 449 |
|
source[scp->sno].sflags & SFOLLOW )) { |
| 450 |
|
/* follow entire path */ |
| 451 |
|
raycont(&sr); |
| 451 |
– |
rayparticipate(&sr); |
| 452 |
|
if (trace != NULL) |
| 453 |
|
(*trace)(&sr); /* trace execution */ |
| 454 |
+ |
rayparticipate(&sr); |
| 455 |
|
if (bright(sr.rcol) <= FTINY) { |
| 456 |
|
#if SHADCACHE |
| 457 |
|
if ((scp <= srccnt || scp[-1].sno != scp->sno) |
| 665 |
|
) |
| 666 |
|
{ |
| 667 |
|
/* check for over-counting */ |
| 668 |
< |
if (badcomponent(m, r)) |
| 668 |
> |
if (badcomponent(m, r)) { |
| 669 |
> |
setcolor(r->rcoef, 0.0, 0.0, 0.0); |
| 670 |
|
return(1); |
| 671 |
< |
if (wrongsource(m, r)) |
| 671 |
> |
} |
| 672 |
> |
if (wrongsource(m, r)) { |
| 673 |
> |
setcolor(r->rcoef, 0.0, 0.0, 0.0); |
| 674 |
|
return(1); |
| 675 |
+ |
} |
| 676 |
|
/* check for passed illum */ |
| 677 |
|
if (passillum(m, r)) { |
| 678 |
|
if (m->oargs.nsargs && strcmp(m->oargs.sarg[0], VOIDID)) |
| 680 |
|
raytrans(r); |
| 681 |
|
return(1); |
| 682 |
|
} |
| 683 |
+ |
/* check for invisibility */ |
| 684 |
+ |
if (srcignore(m, r)) { |
| 685 |
+ |
setcolor(r->rcoef, 0.0, 0.0, 0.0); |
| 686 |
+ |
return(1); |
| 687 |
+ |
} |
| 688 |
|
/* otherwise treat as source */ |
| 689 |
|
/* check for behind */ |
| 690 |
|
if (r->rod < 0.0) |
| 681 |
– |
return(1); |
| 682 |
– |
/* check for invisibility */ |
| 683 |
– |
if (srcignore(m, r)) |
| 691 |
|
return(1); |
| 692 |
|
/* check for outside spot */ |
| 693 |
|
if (m->otype==MAT_SPOT && spotout(r, makespot(m))) |