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 2.11 by greg, Wed Apr 17 14:01:52 1996 UTC vs.
Revision 2.13 by gwlarson, Wed Jun 17 12:53:07 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4 < static char SCCSid[] = "$SunId$ LBL";
4 > static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
# Line 73 | Line 73 | register RAY  *r;
73          double  cos1, cos2, nratio;
74          COLOR  ctrans;
75          COLOR  talb;
76        double  mabsorp;
76          double  refl, trans;
77          FVECT  dnorm;
78          double  d1, d2;
# Line 128 | Line 127 | register RAY  *r;
127                          r->gecc = 0.;
128                  }
129          }
131        mabsorp = exp(-bright(r->cext)*r->rot);         /* approximate */
130  
131          d2 = 1.0 - nratio*nratio*(1.0 - cos1*cos1);     /* compute cos theta2 */
132  
# Line 152 | Line 150 | register RAY  *r;
150                  refl *= 0.5;
151                  trans = 1.0 - refl;
152  
153 <                if (rayorigin(&p, r, REFRACTED, mabsorp*trans) == 0) {
153 >                if (rayorigin(&p, r, REFRACTED, trans) == 0) {
154  
155                                                  /* compute refracted ray */
156                          d1 = nratio*cos1 - cos2;
# Line 165 | Line 163 | register RAY  *r;
163                                          || r->crtype & SHADOW
164                                          || !directvis
165                                          || m->oargs.farg[4] == 0.0
166 <                                        || !disperse(m, r, p.rdir, trans))
166 >                                        || !disperse(m, r, p.rdir,
167 >                                                        trans, ctrans, talb))
168   #endif
169                          {
170                                  copycolor(p.cext, ctrans);
# Line 180 | Line 179 | register RAY  *r;
179          }
180                  
181          if (!(r->crtype & SHADOW) &&
182 <                        rayorigin(&p, r, REFLECTED, mabsorp*refl) == 0) {
182 >                        rayorigin(&p, r, REFLECTED, refl) == 0) {
183  
184                                          /* compute reflected ray */
185                  for (i = 0; i < 3; i++)
# Line 199 | Line 198 | register RAY  *r;
198   #ifdef  DISPERSE
199  
200   static
201 < disperse(m, r, vt, tr)          /* check light sources for dispersion */
201 > disperse(m, r, vt, tr, cet, abt)  /* check light sources for dispersion */
202   OBJREC  *m;
203   RAY  *r;
204   FVECT  vt;
205   double  tr;
206 + COLOR  cet, abt;
207   {
208          RAY  sray, *entray;
209          FVECT  v1, v2, n1, n2;
# Line 289 | Line 289 | double  tr;
289                  if (l1 > MAXLAMBDA || l1 < MINLAMBDA)   /* not visible */
290                          continue;
291                                                  /* trace source ray */
292 +                copycolor(sray.cext, cet);
293 +                copycolor(sray.albedo, abt);
294                  normalize(sray.rdir);
295                  rayvalue(&sray);
296                  if (bright(sray.rcol) <= FTINY) /* missed it */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines