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

Comparing ray/src/rt/glass.c (file contents):
Revision 1.1 by greg, Thu Feb 2 10:41:24 1989 UTC vs.
Revision 1.3 by greg, Tue Mar 27 11:40:00 1990 UTC

# Line 80 | Line 80 | register RAY  *r;
80                  colval(trans,i) = (1.0-r1)*(1.0-r1)*d / (1.0 - r1*r1*d*d);
81          }
82                                                  /* transmitted ray */
83 <        if (rayorigin(&p, r, TRANS, intens(trans)) == 0) {
83 >        if (rayorigin(&p, r, TRANS, bright(trans)) == 0) {
84                  VCOPY(p.rdir, r->rdir);
85                  rayvalue(&p);
86                  multcolor(p.rcol, r->pcol);     /* modify */
87                  multcolor(p.rcol, trans);
88                  addcolor(r->rcol, p.rcol);
89 +                r->rt = r->rot + p.rt;
90          }
91 +
92          if (r->crtype & SHADOW)                 /* skip reflected ray */
93                  return;
94                                                  /* compute reflectance */
# Line 96 | Line 98 | register RAY  *r;
98                  colval(refl,i) = r1 * (1.0 + (1.0-2.0*r1)*d) / (1.0 - r1*r1*d);
99          }
100                                                  /* reflected ray */
101 <        if (rayorigin(&p, r, REFLECTED, intens(refl)) == 0) {
101 >        if (rayorigin(&p, r, REFLECTED, bright(refl)) == 0) {
102                  for (i = 0; i < 3; i++)
103                          p.rdir[i] = r->rdir[i] + 2.0*pdot*pnorm[i];
104                  rayvalue(&p);
105                  multcolor(p.rcol, refl);
106                  addcolor(r->rcol, p.rcol);
107 +                if (bright(refl) > bright(trans))
108 +                        r->rt = r->rot + p.rt;
109          }
110   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines