| 1 |
< |
/* Copyright (c) 1996 Regents of the University of California */ |
| 1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
|
|
| 3 |
|
#ifndef lint |
| 4 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
| 4 |
> |
static char SCCSid[] = "$SunId$ SGI"; |
| 5 |
|
#endif |
| 6 |
|
|
| 7 |
|
/* |
| 54 |
|
int rt; |
| 55 |
|
double rw; |
| 56 |
|
{ |
| 57 |
+ |
double re; |
| 58 |
+ |
|
| 59 |
|
if ((r->parent = ro) == NULL) { /* primary ray */ |
| 60 |
|
r->rlvl = 0; |
| 61 |
|
r->rweight = rw; |
| 84 |
|
copycolor(r->albedo, ro->albedo); |
| 85 |
|
r->gecc = ro->gecc; |
| 86 |
|
r->slights = ro->slights; |
| 85 |
– |
r->rweight = ro->rweight * rw; |
| 87 |
|
r->crtype = ro->crtype | (r->rtype = rt); |
| 88 |
|
VCOPY(r->rorg, ro->rop); |
| 89 |
+ |
r->rweight = ro->rweight * rw; |
| 90 |
+ |
/* estimate absorption */ |
| 91 |
+ |
re = colval(ro->cext,RED) < colval(ro->cext,GRN) ? |
| 92 |
+ |
colval(ro->cext,RED) : colval(ro->cext,GRN); |
| 93 |
+ |
if (colval(ro->cext,BLU) < re) re = colval(ro->cext,BLU); |
| 94 |
+ |
if (re > 0.) |
| 95 |
+ |
r->rweight *= exp(-re*ro->rot); |
| 96 |
|
} |
| 97 |
|
rayclear(r); |
| 98 |
|
return(r->rlvl <= maxdepth && r->rweight >= minweight ? 0 : -1); |