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.19 by greg, Thu Sep 9 06:46:07 2004 UTC vs.
Revision 2.20 by greg, Tue Apr 19 01:15:06 2005 UTC

# Line 164 | Line 164 | m_dielectric(  /* color a ray which hit a dielectric in
164  
165                  trans *= nratio*nratio;         /* solid angle ratio */
166  
167 <                if (rayorigin(&p, r, REFRACTED, trans) == 0) {
167 >                setcolor(p.rcoef, trans, trans, trans);
168  
169 +                if (rayorigin(&p, REFRACTED, r, p.rcoef) == 0) {
170 +
171                                                  /* compute refracted ray */
172                          d1 = nratio*cos1 - cos2;
173                          for (i = 0; i < 3; i++)
# Line 192 | Line 194 | m_dielectric(  /* color a ray which hit a dielectric in
194                                  copycolor(p.cext, ctrans);
195                                  copycolor(p.albedo, talb);
196                                  rayvalue(&p);
197 <                                scalecolor(p.rcol, trans);
197 >                                multcolor(p.rcol, p.rcoef);
198                                  addcolor(r->rcol, p.rcol);
199                                                  /* virtual distance */
200                                  if (flatsurface ||
# Line 204 | Line 206 | m_dielectric(  /* color a ray which hit a dielectric in
206                          }
207                  }
208          }
209 <                
209 >        setcolor(p.rcoef, refl, refl, refl);
210 >
211          if (!(r->crtype & SHADOW) &&
212 <                        rayorigin(&p, r, REFLECTED, refl) == 0) {
212 >                        rayorigin(&p, REFLECTED, r, p.rcoef) == 0) {
213  
214                                          /* compute reflected ray */
215                  for (i = 0; i < 3; i++)
# Line 218 | Line 221 | m_dielectric(  /* color a ray which hit a dielectric in
221  
222                  rayvalue(&p);                   /* reflected ray value */
223  
224 <                scalecolor(p.rcol, refl);       /* color contribution */
224 >                multcolor(p.rcol, p.rcoef);     /* color contribution */
225                  addcolor(r->rcol, p.rcol);
226                                                  /* virtual distance */
227                  if (flatsurface) {
# Line 249 | Line 252 | disperse(  /* check light sources for dispersion */
252          COLOR  abt
253   )
254   {
255 <        RAY  sray, *entray;
255 >        RAY  sray;
256 >        const RAY  *entray;
257          FVECT  v1, v2, n1, n2;
258          FVECT  dv, v2Xdv;
259          double  v2Xdvv2Xdv;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines