338 |
|
register int sn; |
339 |
|
int nshadcheck, ncnts; |
340 |
|
int nhits; |
341 |
< |
double prob, ourthresh, hwt; |
341 |
> |
double dom, prob, ourthresh, hwt; |
342 |
|
RAY sr; |
343 |
|
/* NOTE: srccnt and cntord global so no recursion */ |
344 |
|
if (nsources <= 0) |
352 |
|
cntord[sn].sno = sn; |
353 |
|
cntord[sn].brt = 0.0; |
354 |
|
/* get source ray */ |
355 |
< |
if ((srccnt[sn].dom = srcray(&sr, r, sn)) == 0.0) |
355 |
> |
if ((dom = srcray(&sr, r, sn)) == 0.0) |
356 |
|
continue; |
357 |
|
VCOPY(srccnt[sn].dir, sr.rdir); |
358 |
|
/* compute coefficient */ |
359 |
< |
(*f)(srccnt[sn].val, p, srccnt[sn].dir, srccnt[sn].dom); |
360 |
< |
cntord[sn].brt = bright(srccnt[sn].val); |
359 |
> |
(*f)(srccnt[sn].coef, p, srccnt[sn].dir, dom); |
360 |
> |
cntord[sn].brt = bright(srccnt[sn].coef); |
361 |
|
if (cntord[sn].brt <= 0.0) |
362 |
|
continue; |
363 |
|
/* compute contribution */ |
364 |
|
srcvalue(&sr); |
365 |
< |
multcolor(srccnt[sn].val, sr.rcol); |
365 |
> |
copycolor(srccnt[sn].val, sr.rcol); |
366 |
> |
multcolor(srccnt[sn].val, srccnt[sn].coef); |
367 |
|
cntord[sn].brt = bright(srccnt[sn].val); |
368 |
|
} |
369 |
|
/* sort contributions */ |
404 |
|
raycont(&sr); |
405 |
|
if (bright(sr.rcol) <= FTINY) |
406 |
|
continue; /* missed! */ |
407 |
< |
(*f)(srccnt[cntord[sn].sno].val, p, |
408 |
< |
srccnt[cntord[sn].sno].dir, |
409 |
< |
srccnt[cntord[sn].sno].dom); |
409 |
< |
multcolor(srccnt[cntord[sn].sno].val, sr.rcol); |
407 |
> |
copycolor(srccnt[cntord[sn].sno].val, sr.rcol); |
408 |
> |
multcolor(srccnt[cntord[sn].sno].val, |
409 |
> |
srccnt[cntord[sn].sno].coef); |
410 |
|
} |
411 |
|
/* add contribution if hit */ |
412 |
|
addcolor(r->rcol, srccnt[cntord[sn].sno].val); |