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 1.3 by greg, Tue Mar 27 11:40:00 1990 UTC vs.
Revision 1.6 by greg, Tue May 7 17:45:51 1991 UTC

# Line 60 | Line 60 | register RAY  *r;
60  
61          if (r->rod < 0.0)                       /* reorient if necessary */
62                  flipsurface(r);
63 +        r->rt = r->rot;                         /* default ray length */
64                                                  /* get modifiers */
65          raytexture(r, m->omod);
66          pdot = raynormal(pnorm, r);
# Line 81 | Line 82 | register RAY  *r;
82          }
83                                                  /* transmitted ray */
84          if (rayorigin(&p, r, TRANS, bright(trans)) == 0) {
85 <                VCOPY(p.rdir, r->rdir);
85 >                for (i = 0; i < 3; i++)         /* perturb direction */
86 >                        p.rdir[i] = r->rdir[i] - r->pert[i]/RINDEX;
87 >                normalize(p.rdir);
88                  rayvalue(&p);
89                  multcolor(p.rcol, r->pcol);     /* modify */
90                  multcolor(p.rcol, trans);
91                  addcolor(r->rcol, p.rcol);
92 <                r->rt = r->rot + p.rt;
92 >                if (bright(p.rcol) > .5)
93 >                        r->rt = r->rot + p.rt;
94          }
95  
96          if (r->crtype & SHADOW)                 /* skip reflected ray */
# Line 104 | Line 108 | register RAY  *r;
108                  rayvalue(&p);
109                  multcolor(p.rcol, refl);
110                  addcolor(r->rcol, p.rcol);
107                if (bright(refl) > bright(trans))
108                        r->rt = r->rot + p.rt;
111          }
112   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines