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.4 by greg, Wed May 30 19:56:58 1990 UTC vs.
Revision 1.5 by greg, Mon Oct 15 20:39:30 1990 UTC

# Line 57 | Line 57 | register RAY  *r;
57          double  cos1, cos2, nratio;
58          COLOR  mcolor;
59          double  mabsorp;
60 <        double  refl, trans, transbright;
60 >        double  refl, trans;
61          FVECT  dnorm;
62          double  d1, d2;
63          RAY  p;
# Line 66 | Line 66 | register RAY  *r;
66          if (m->oargs.nfargs != (m->otype==MAT_DIELECTRIC ? 5 : 8))
67                  objerror(m, USER, "bad arguments");
68  
69 +        r->rt = r->rot;                         /* just use ray length */
70 +
71          raytexture(r, m->omod);                 /* get modifiers */
72  
73          cos1 = raynormal(dnorm, r);             /* cosine of theta1 */
# Line 115 | Line 117 | register RAY  *r;
117  
118                  refl /= 2.0;
119                  trans = 1.0 - refl;
118                transbright = -FTINY;
120  
121                  if (rayorigin(&p, r, REFRACTED, mabsorp*trans) == 0) {
122  
# Line 136 | Line 137 | register RAY  *r;
137                                  multcolor(mcolor, r->pcol);     /* modify */
138                                  scalecolor(p.rcol, trans);
139                                  addcolor(r->rcol, p.rcol);
139                                transbright = bright(p.rcol);
140                                r->rt = r->rot + p.rt;
140                          }
141                  }
142          }
# Line 153 | Line 152 | register RAY  *r;
152  
153                  scalecolor(p.rcol, refl);       /* color contribution */
154                  addcolor(r->rcol, p.rcol);
156                if (bright(p.rcol) > transbright)
157                        r->rt = r->rot + p.rt;
155          }
156  
157          multcolor(r->rcol, mcolor);             /* multiply by transmittance */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines