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.12 by greg, Thu Jul 11 15:14:05 1996 UTC

# Line 128 | Line 128 | register RAY  *r;
128                          r->gecc = 0.;
129                  }
130          }
131 <        mabsorp = exp(-bright(r->cext)*r->rot);         /* approximate */
131 >                                                /* estimate absorption */
132 >        mabsorp = colval(r->cext,RED) < colval(r->cext,GRN) ?
133 >                        colval(r->cext,RED) : colval(r->cext,GRN);
134 >        if (colval(r->cext,BLU) < mabsorp) mabsorp = colval(r->cext,BLU);
135 >        if (mabsorp > 0.)
136 >                mabsorp = exp(-mabsorp*r->rot);         /* conservative */
137 >        else
138 >                mabsorp = 1.0;
139  
140          d2 = 1.0 - nratio*nratio*(1.0 - cos1*cos1);     /* compute cos theta2 */
141  
# Line 165 | Line 172 | register RAY  *r;
172                                          || r->crtype & SHADOW
173                                          || !directvis
174                                          || m->oargs.farg[4] == 0.0
175 <                                        || !disperse(m, r, p.rdir, trans))
175 >                                        || !disperse(m, r, p.rdir,
176 >                                                        trans, ctrans, talb))
177   #endif
178                          {
179                                  copycolor(p.cext, ctrans);
# Line 199 | Line 207 | register RAY  *r;
207   #ifdef  DISPERSE
208  
209   static
210 < disperse(m, r, vt, tr)          /* check light sources for dispersion */
210 > disperse(m, r, vt, tr, cet, abt)  /* check light sources for dispersion */
211   OBJREC  *m;
212   RAY  *r;
213   FVECT  vt;
214   double  tr;
215 + COLOR  cet, abt;
216   {
217          RAY  sray, *entray;
218          FVECT  v1, v2, n1, n2;
# Line 289 | Line 298 | double  tr;
298                  if (l1 > MAXLAMBDA || l1 < MINLAMBDA)   /* not visible */
299                          continue;
300                                                  /* trace source ray */
301 +                copycolor(sray.cext, cet);
302 +                copycolor(sray.albedo, abt);
303                  normalize(sray.rdir);
304                  rayvalue(&sray);
305                  if (bright(sray.rcol) <= FTINY) /* missed it */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines