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.6 by greg, Mon Aug 5 13:52:20 1991 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 128 | Line 129 | register RAY  *r;
129                          if (m->otype != MAT_DIELECTRIC
130                                          || r->rod > 0.0
131                                          || r->crtype & SHADOW
132 +                                        || directinvis
133                                          || m->oargs.farg[4] == 0.0
134                                          || !disperse(m, r, p.rdir, trans))
135   #endif
# Line 136 | Line 138 | register RAY  *r;
138                                  multcolor(mcolor, r->pcol);     /* modify */
139                                  scalecolor(p.rcol, trans);
140                                  addcolor(r->rcol, p.rcol);
139                                transbright = bright(p.rcol);
140                                r->rt = r->rot + p.rt;
141                          }
142                  }
143          }
# Line 153 | Line 153 | register RAY  *r;
153  
154                  scalecolor(p.rcol, refl);       /* color contribution */
155                  addcolor(r->rcol, p.rcol);
156                if (bright(p.rcol) > transbright)
157                        r->rt = r->rot + p.rt;
156          }
157  
158          multcolor(r->rcol, mcolor);             /* multiply by transmittance */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines