--- ray/src/rt/glass.c 1990/03/27 11:40:00 1.3 +++ ray/src/rt/glass.c 1991/05/07 17:45:51 1.6 @@ -60,6 +60,7 @@ register RAY *r; if (r->rod < 0.0) /* reorient if necessary */ flipsurface(r); + r->rt = r->rot; /* default ray length */ /* get modifiers */ raytexture(r, m->omod); pdot = raynormal(pnorm, r); @@ -81,12 +82,15 @@ register RAY *r; } /* transmitted ray */ if (rayorigin(&p, r, TRANS, bright(trans)) == 0) { - VCOPY(p.rdir, r->rdir); + for (i = 0; i < 3; i++) /* perturb direction */ + p.rdir[i] = r->rdir[i] - r->pert[i]/RINDEX; + normalize(p.rdir); rayvalue(&p); multcolor(p.rcol, r->pcol); /* modify */ multcolor(p.rcol, trans); addcolor(r->rcol, p.rcol); - r->rt = r->rot + p.rt; + if (bright(p.rcol) > .5) + r->rt = r->rot + p.rt; } if (r->crtype & SHADOW) /* skip reflected ray */ @@ -104,7 +108,5 @@ register RAY *r; rayvalue(&p); multcolor(p.rcol, refl); addcolor(r->rcol, p.rcol); - if (bright(refl) > bright(trans)) - r->rt = r->rot + p.rt; } }