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.4 by greg, Wed May 30 19:57:01 1990 UTC

# Line 49 | Line 49 | register RAY  *r;
49          FVECT  pnorm;
50          double  cos2;
51          COLOR  trans, refl;
52 +        double  transbright;
53          double  d, r1;
54          RAY  p;
55          register int  i;
# Line 79 | Line 80 | register RAY  *r;
80                  d = colval(mcolor, i);
81                  colval(trans,i) = (1.0-r1)*(1.0-r1)*d / (1.0 - r1*r1*d*d);
82          }
83 +        transbright = -FTINY;
84                                                  /* transmitted ray */
85 <        if (rayorigin(&p, r, TRANS, intens(trans)) == 0) {
85 >        if (rayorigin(&p, r, TRANS, bright(trans)) == 0) {
86                  VCOPY(p.rdir, r->rdir);
87                  rayvalue(&p);
88                  multcolor(p.rcol, r->pcol);     /* modify */
89                  multcolor(p.rcol, trans);
90                  addcolor(r->rcol, p.rcol);
91 +                transbright = bright(p.rcol);
92 +                r->rt = r->rot + p.rt;
93          }
94 +
95          if (r->crtype & SHADOW)                 /* skip reflected ray */
96                  return;
97                                                  /* compute reflectance */
# Line 96 | Line 101 | register RAY  *r;
101                  colval(refl,i) = r1 * (1.0 + (1.0-2.0*r1)*d) / (1.0 - r1*r1*d);
102          }
103                                                  /* reflected ray */
104 <        if (rayorigin(&p, r, REFLECTED, intens(refl)) == 0) {
104 >        if (rayorigin(&p, r, REFLECTED, bright(refl)) == 0) {
105                  for (i = 0; i < 3; i++)
106                          p.rdir[i] = r->rdir[i] + 2.0*pdot*pnorm[i];
107                  rayvalue(&p);
108                  multcolor(p.rcol, refl);
109                  addcolor(r->rcol, p.rcol);
110 +                if (bright(p.rcol) > transbright)
111 +                        r->rt = r->rot + p.rt;
112          }
113   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines