364 |
|
return(0); /* nothing usable */ |
365 |
|
} |
366 |
|
/* |
367 |
< |
* Make assignments. |
367 |
> |
* Assign object index |
368 |
|
*/ |
369 |
|
r->robj = objndx(r->ro); |
370 |
– |
for (i = 0; i < 3; i++) |
371 |
– |
r->ron[i] = -r->rdir[i]; |
372 |
– |
r->rod = 1.0; |
373 |
– |
r->pert[0] = r->pert[1] = r->pert[2] = 0.0; |
374 |
– |
r->uv[0] = r->uv[1] = 0.0; |
375 |
– |
r->rox = NULL; |
370 |
|
return(1); |
371 |
|
} |
372 |
|
|
428 |
|
cntord[sn].sndx = sn; |
429 |
|
scp = srccnt + sn; |
430 |
|
scp->sno = sr.rsrc; |
431 |
< |
/* compute coefficient */ |
438 |
< |
(*f)(scp->coef, p, sr.rdir, si.dom); |
439 |
< |
cntord[sn].brt = intens(scp->coef); |
440 |
< |
if (cntord[sn].brt <= 0.0) |
441 |
< |
continue; |
442 |
< |
#if SHADCACHE |
443 |
< |
/* check shadow cache */ |
431 |
> |
#if SHADCACHE /* check shadow cache */ |
432 |
|
if (si.np == 1 && srcblocked(&sr)) { |
433 |
|
cntord[sn].brt = 0.0; |
434 |
|
continue; |
435 |
|
} |
436 |
|
#endif |
437 |
+ |
/* compute coefficient */ |
438 |
+ |
(*f)(scp->coef, p, sr.rdir, si.dom); |
439 |
+ |
cntord[sn].brt = intens(scp->coef); |
440 |
+ |
if (cntord[sn].brt <= 0.0) |
441 |
+ |
continue; |
442 |
|
VCOPY(scp->dir, sr.rdir); |
443 |
|
copycolor(sr.rcoef, scp->coef); |
444 |
|
/* compute potential */ |
471 |
|
/* compute number to check */ |
472 |
|
nshadcheck = pow((double)ncnts, shadcert) + .5; |
473 |
|
/* modify threshold */ |
474 |
< |
if (ncnts > MINSHADCNT) |
482 |
< |
ourthresh = shadthresh / r->rweight; |
483 |
< |
else |
484 |
< |
ourthresh = 0; |
474 |
> |
ourthresh = shadthresh / r->rweight; |
475 |
|
/* test for shadows */ |
476 |
|
for (nhits = 0, hwt = 0.0, sn = 0; sn < ncnts; |
477 |
|
hwt += (double)source[scp->sno].nhits / |
478 |
|
(double)source[scp->sno].ntests, |
479 |
|
sn++) { |
480 |
|
/* check threshold */ |
481 |
< |
if ((sn+nshadcheck>=ncnts ? cntord[sn].brt : |
481 |
> |
if (sn >= MINSHADCNT && |
482 |
> |
(sn+nshadcheck>=ncnts ? cntord[sn].brt : |
483 |
|
cntord[sn].brt-cntord[sn+nshadcheck].brt) |
484 |
< |
< ourthresh*bright(r->rcol)) |
484 |
> |
< ourthresh*bright(r->rcol)) |
485 |
|
break; |
486 |
|
scp = srccnt + cntord[sn].sndx; |
487 |
|
/* test for hit */ |