| 55 |
|
ao = objptr(aobj); |
| 56 |
|
if (ismaterial(ao->otype)) |
| 57 |
|
return(ao); |
| 58 |
+ |
if (ao->otype == MOD_ALIAS) { |
| 59 |
+ |
o = ao; |
| 60 |
+ |
continue; |
| 61 |
+ |
} |
| 62 |
|
} |
| 63 |
|
if (o->omod == OVOID) |
| 64 |
|
return(NULL); |
| 386 |
|
scp->sno = sr.rsrc; |
| 387 |
|
/* compute coefficient */ |
| 388 |
|
(*f)(scp->coef, p, sr.rdir, si.dom); |
| 389 |
< |
cntord[sn].brt = bright(scp->coef); |
| 389 |
> |
cntord[sn].brt = intens(scp->coef); |
| 390 |
|
if (cntord[sn].brt <= 0.0) |
| 391 |
|
continue; |
| 392 |
|
#if SHADCACHE |
| 399 |
|
VCOPY(scp->dir, sr.rdir); |
| 400 |
|
copycolor(sr.rcoef, scp->coef); |
| 401 |
|
/* compute potential */ |
| 402 |
< |
srcvalue(&sr); |
| 402 |
> |
sr.revf = srcvalue; |
| 403 |
> |
rayvalue(&sr); |
| 404 |
|
multcolor(sr.rcol, sr.rcoef); |
| 405 |
|
copycolor(scp->val, sr.rcol); |
| 406 |
< |
cntord[sn].brt = bright(scp->val); |
| 406 |
> |
cntord[sn].brt = intens(sr.rcol); |
| 407 |
|
} |
| 408 |
|
/* sort contributions */ |
| 409 |
|
qsort(cntord, sn, sizeof(CNTPTR), cntcmp); |
| 442 |
|
scp = srccnt + cntord[sn].sndx; |
| 443 |
|
/* test for hit */ |
| 444 |
|
rayorigin(&sr, SHADOW, r, NULL); |
| 445 |
+ |
copycolor(sr.rcoef, scp->coef); |
| 446 |
|
VCOPY(sr.rdir, scp->dir); |
| 447 |
|
sr.rsrc = scp->sno; |
| 448 |
|
/* keep statistics */ |
| 457 |
|
raycont(&sr); |
| 458 |
|
if (trace != NULL) |
| 459 |
|
(*trace)(&sr); /* trace execution */ |
| 454 |
– |
rayparticipate(&sr); |
| 460 |
|
if (bright(sr.rcol) <= FTINY) { |
| 461 |
|
#if SHADCACHE |
| 462 |
|
if ((scp <= srccnt || scp[-1].sno != scp->sno) |
| 466 |
|
#endif |
| 467 |
|
continue; /* missed! */ |
| 468 |
|
} |
| 469 |
+ |
rayparticipate(&sr); |
| 470 |
+ |
multcolor(sr.rcol, sr.rcoef); |
| 471 |
|
copycolor(scp->val, sr.rcol); |
| 472 |
< |
multcolor(scp->val, scp->coef); |
| 472 |
> |
} else if (trace != NULL && |
| 473 |
> |
(source[scp->sno].sflags & (SDISTANT|SVIRTUAL|SFOLLOW)) |
| 474 |
> |
== (SDISTANT|SFOLLOW) && |
| 475 |
> |
sourcehit(&sr) && rayshade(&sr, sr.ro->omod)) { |
| 476 |
> |
(*trace)(&sr); /* trace execution */ |
| 477 |
> |
/* skip call to rayparticipate() & scp->val update */ |
| 478 |
|
} |
| 479 |
|
/* add contribution if hit */ |
| 480 |
|
addcolor(r->rcol, scp->val); |
| 496 |
|
scp = srccnt + cntord[sn].sndx; |
| 497 |
|
prob = hwt * (double)source[scp->sno].nhits / |
| 498 |
|
(double)source[scp->sno].ntests; |
| 499 |
< |
if (prob > 1.0) |
| 500 |
< |
prob = 1.0; |
| 489 |
< |
scalecolor(scp->val, prob); |
| 499 |
> |
if (prob < 1.0) |
| 500 |
> |
scalecolor(scp->val, prob); |
| 501 |
|
addcolor(r->rcol, scp->val); |
| 502 |
|
} |
| 503 |
|
} |