| 329 |
|
/* compute coefficient */ |
| 330 |
|
(*f)(srccnt[sn].val, p, srccnt[sn].dir, srccnt[sn].dom); |
| 331 |
|
cntord[sn].brt = bright(srccnt[sn].val); |
| 332 |
< |
if (cntord[sn].brt <= FTINY) |
| 332 |
> |
if (cntord[sn].brt <= 0.0) |
| 333 |
|
continue; |
| 334 |
|
/* compute intersection */ |
| 335 |
|
if (!( source[sn].sflags & SDISTANT ? |
| 338 |
|
(source[sn].so, &sr) )) |
| 339 |
|
continue; |
| 340 |
|
/* compute contribution */ |
| 341 |
< |
rayshade(&sr, sr.ro->omod); |
| 341 |
> |
raycont(&sr); |
| 342 |
|
multcolor(srccnt[sn].val, sr.rcol); |
| 343 |
|
cntord[sn].brt = bright(srccnt[sn].val); |
| 344 |
|
} |
| 376 |
|
/* test for hit */ |
| 377 |
|
rayorigin(&sr, r, SHADOW, 1.0); |
| 378 |
|
VCOPY(sr.rdir, srccnt[cntord[sn].sno].dir); |
| 379 |
+ |
sr.rsrc = cntord[sn].sno; |
| 380 |
|
if (localhit(&sr, &thescene) && |
| 381 |
|
sr.ro != source[cntord[sn].sno].so) { |
| 382 |
|
/* check for transmission */ |
| 383 |
< |
if (sr.clipset != NULL && inset(sr.clipset,sr.ro->omod)) |
| 383 |
< |
raytrans(&sr); /* object is clipped */ |
| 384 |
< |
else |
| 385 |
< |
rayshade(&sr, sr.ro->omod); |
| 383 |
> |
raycont(&sr); |
| 384 |
|
if (bright(sr.rcol) <= FTINY) |
| 385 |
|
continue; /* missed! */ |
| 386 |
|
(*f)(srccnt[cntord[sn].sno].val, p, |
| 429 |
|
register OBJREC *m; |
| 430 |
|
register RAY *r; |
| 431 |
|
{ |
| 434 |
– |
/* check for behind */ |
| 435 |
– |
if (r->rod < 0.0) |
| 436 |
– |
return; |
| 432 |
|
/* check for over-counting */ |
| 433 |
|
if (wrongsource(m, r) || badambient(m, r)) |
| 434 |
|
return; |
| 442 |
|
|
| 443 |
|
/* otherwise treat as source */ |
| 444 |
|
} else { |
| 445 |
+ |
/* check for behind */ |
| 446 |
+ |
if (r->rod < 0.0) |
| 447 |
+ |
return; |
| 448 |
|
/* get distribution pattern */ |
| 449 |
|
raytexture(r, m->omod); |
| 450 |
|
/* get source color */ |
| 453 |
|
m->oargs.farg[2]); |
| 454 |
|
/* modify value */ |
| 455 |
|
multcolor(r->rcol, r->pcol); |
| 456 |
+ |
/* assign distance */ |
| 457 |
+ |
r->rt = r->rot; |
| 458 |
|
} |
| 459 |
|
} |
| 460 |
|
|