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.1 by greg, Thu Feb 2 10:41:21 1989 UTC vs.
Revision 1.7 by greg, Mon Oct 21 12:58:12 1991 UTC

# 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 92 | Line 94 | register RAY  *r;
94                  else
95                          setcolor(mcolor, 1.0, 1.0, 1.0);
96          }
97 <        mabsorp = intens(mcolor);
97 >        mabsorp = bright(mcolor);
98  
99          d2 = 1.0 - nratio*nratio*(1.0 - cos1*cos1);     /* compute cos theta2 */
100  
# Line 127 | 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 170 | Line 173 | double  tr;
173          FVECT  v1, v2, n1, n2;
174          FVECT  dv, v2Xdv;
175          double  v2Xdvv2Xdv;
176 <        int  sn, success = 0;
177 <        double  omega;
176 >        int  success = 0;
177 >        SRCINDEX  si;
178          FVECT  vtmp1, vtmp2;
179          double  dtmp1, dtmp2;
180          int  l1, l2;
# Line 233 | Line 236 | double  tr;
236          v2Xdvv2Xdv = DOT(v2Xdv, v2Xdv);
237  
238                                          /* check sources */
239 <        for (sn = 0; sn < nsources; sn++) {
239 >        initsrcindex(&si);
240 >        while (srcray(&sray, r, &si)) {
241  
242 <                if ((omega = srcray(&sray, r, sn)) == 0.0 ||
239 <                                DOT(sray.rdir, v2) < MINCOS)
242 >                if (DOT(sray.rdir, v2) < MINCOS)
243                          continue;                       /* bad source */
241                
244                                                  /* adjust source ray */
245  
246                  dtmp1 = DOT(v2Xdv, sray.rdir) / v2Xdvv2Xdv;
# Line 253 | Line 255 | double  tr;
255                                                  /* trace source ray */
256                  normalize(sray.rdir);
257                  rayvalue(&sray);
258 <                if (intens(sray.rcol) <= FTINY) /* missed it */
258 >                if (bright(sray.rcol) <= FTINY) /* missed it */
259                          continue;
260                  
261                  /*
# Line 263 | Line 265 | double  tr;
265                   */
266                  
267                  fcross(vtmp1, v2Xdv, sray.rdir);
268 <                dtmp1 = sqrt(omega  / v2Xdvv2Xdv / PI);
268 >                dtmp1 = sqrt(si.dom  / v2Xdvv2Xdv / PI);
269  
270                                                          /* compute first ray */
271                  for (i = 0; i < 3; i++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines