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.28 by greg, Wed Oct 28 15:45:58 2015 UTC vs.
Revision 2.29 by greg, Tue Nov 13 19:58:33 2018 UTC

# Line 74 | Line 74 | m_dielectric(  /* color a ray which hit a dielectric in
74          COLOR  ctrans;
75          COLOR  talb;
76          int  hastexture;
77        double  transdist=0, transtest=0;
78        double  mirdist=0, mirtest=0;
77          int     flatsurface;
78          double  refl, trans;
79          FVECT  dnorm;
# Line 206 | Line 204 | m_dielectric(  /* color a ray which hit a dielectric in
204                                                  /* virtual distance */
205                                  if (flatsurface ||
206                                          (1.-FTINY <= nratio) &
207 <                                                (nratio <= 1.+FTINY)) {
208 <                                        transtest = 2*bright(p.rcol);
211 <                                        transdist = r->rot + p.rt;
212 <                                }
207 >                                                (nratio <= 1.+FTINY))
208 >                                        r->rxt = r->rot + raydistance(&p);
209                          }
210                  }
211          }
# Line 227 | Line 223 | m_dielectric(  /* color a ray which hit a dielectric in
223                  rayvalue(&p);                   /* reflected ray value */
224  
225                  multcolor(p.rcol, p.rcoef);     /* color contribution */
226 +                copycolor(r->mcol, p.rcol);
227                  addcolor(r->rcol, p.rcol);
228                                                  /* virtual distance */
229 <                if (flatsurface) {
230 <                        mirtest = 2*bright(p.rcol);
234 <                        mirdist = r->rot + p.rt;
235 <                }
229 >                if (flatsurface)
230 >                        r->rmt = r->rot + raydistance(&p);
231          }
237                                /* check distance to return */
238        d1 = bright(r->rcol);
239        if (transtest > d1)
240                r->rt = transdist;
241        else if (mirtest > d1)
242                r->rt = mirdist;
232                                  /* rayvalue() computes absorption */
233          return(1);
234   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines