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

Comparing ray/src/rt/dielectric.c (file contents):
Revision 1.3 by greg, Tue Mar 27 11:39:58 1990 UTC vs.
Revision 1.4 by greg, Wed May 30 19:56:58 1990 UTC

# Line 57 | Line 57 | register RAY  *r;
57          double  cos1, cos2, nratio;
58          COLOR  mcolor;
59          double  mabsorp;
60 <        double  refl, trans;
60 >        double  refl, trans, transbright;
61          FVECT  dnorm;
62          double  d1, d2;
63          RAY  p;
# Line 115 | Line 115 | register RAY  *r;
115  
116                  refl /= 2.0;
117                  trans = 1.0 - refl;
118 +                transbright = -FTINY;
119  
120                  if (rayorigin(&p, r, REFRACTED, mabsorp*trans) == 0) {
121  
# Line 135 | Line 136 | register RAY  *r;
136                                  multcolor(mcolor, r->pcol);     /* modify */
137                                  scalecolor(p.rcol, trans);
138                                  addcolor(r->rcol, p.rcol);
139 +                                transbright = bright(p.rcol);
140                                  r->rt = r->rot + p.rt;
141                          }
142                  }
# Line 151 | Line 153 | register RAY  *r;
153  
154                  scalecolor(p.rcol, refl);       /* color contribution */
155                  addcolor(r->rcol, p.rcol);
156 <                if (refl > trans)
156 >                if (bright(p.rcol) > transbright)
157                          r->rt = r->rot + p.rt;
158          }
159  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines