ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/glass.c
(Generate patch)

Comparing ray/src/rt/glass.c (file contents):
Revision 2.18 by greg, Sun Sep 26 15:51:15 2010 UTC vs.
Revision 2.20 by greg, Wed Aug 7 05:10:09 2013 UTC

# Line 50 | Line 50 | m_glass(               /* color a ray which hit a thin glass surfac
50          COLOR  mcolor;
51          double  pdot;
52          FVECT  pnorm;
53 <        double  rindex, cos2;
53 >        double  rindex=0, cos2;
54          COLOR  trans, refl;
55          int  hastexture, hastrans;
56          double  d, r1e, r1m;
# Line 112 | Line 112 | m_glass(               /* color a ray which hit a thin glass surfac
112                                                  /* transmitted ray */
113                  if (rayorigin(&p, TRANS, r, trans) == 0) {
114                          if (!(r->crtype & SHADOW) && hastexture) {
115 <                                for (i = 0; i < 3; i++) /* perturb direction */
116 <                                        p.rdir[i] = r->rdir[i] +
117 <                                                2.*(1.-rindex)*r->pert[i];
115 >                                VSUM(p.rdir, r->rdir, r->pert, 2.*(1.-rindex));
116                                  if (normalize(p.rdir) == 0.0) {
117                                          objerror(m, WARNING, "bad perturbation");
118                                          VCOPY(p.rdir, r->rdir);
# Line 143 | Line 141 | m_glass(               /* color a ray which hit a thin glass surfac
141          }
142                                                  /* reflected ray */
143          if (rayorigin(&p, REFLECTED, r, refl) == 0) {
144 <                for (i = 0; i < 3; i++)
147 <                        p.rdir[i] = r->rdir[i] + 2.0*pdot*pnorm[i];
144 >                VSUM(p.rdir, r->rdir, pnorm, 2.*pdot);
145                  checknorm(p.rdir);
146                  rayvalue(&p);
147                  multcolor(p.rcol, p.rcoef);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines