ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/raytrace.c
(Generate patch)

Comparing ray/src/rt/raytrace.c (file contents):
Revision 2.30 by gwlarson, Wed Apr 29 09:50:41 1998 UTC vs.
Revision 2.31 by gwlarson, Wed Jun 17 12:53:06 1998 UTC

# Line 1 | Line 1
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   /*
# Line 54 | Line 54 | register RAY  *r, *ro;
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;
# Line 82 | Line 84 | double  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);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines