271 |
|
static double sumambient(COLOR acol, RAY *r, FVECT rn, int al, |
272 |
|
AMBTREE *at, FVECT c0, double s); |
273 |
|
static int makeambient(COLOR acol, RAY *r, FVECT rn, int al); |
274 |
< |
static void extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv, |
274 |
> |
static int extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv, |
275 |
|
FVECT uvw[3]); |
276 |
|
|
277 |
|
void |
486 |
|
/* |
487 |
|
* Extrapolate value and compute final weight (hat function) |
488 |
|
*/ |
489 |
< |
extambient(ct, av, r->rop, rn, uvw); |
489 |
> |
if (!extambient(ct, av, r->rop, rn, uvw)) |
490 |
> |
continue; |
491 |
|
d = tfunc(maxangle, sqrt(delta_r2), 0.0) * |
492 |
|
tfunc(ambacc, sqrt(delta_t2), 0.0); |
493 |
|
scalecolor(ct, d); |
538 |
|
} |
539 |
|
|
540 |
|
|
541 |
< |
static void |
541 |
> |
static int |
542 |
|
extambient( /* extrapolate value at pv, nv */ |
543 |
|
COLOR cr, |
544 |
|
AMBVAL *ap, |
568 |
|
|
569 |
|
if (d <= 0.0) { |
570 |
|
setcolor(cr, 0.0, 0.0, 0.0); |
571 |
< |
return; |
571 |
> |
return(0); /* should not use if we can avoid it */ |
572 |
|
} |
573 |
|
copycolor(cr, ap->val); |
574 |
|
scalecolor(cr, d); |
575 |
+ |
return(1); |
576 |
|
} |
577 |
|
|
578 |
|
|