--- ray/src/rt/glass.c 1990/05/30 19:57:01 1.4 +++ ray/src/rt/glass.c 1990/10/15 20:39:32 1.5 @@ -49,7 +49,6 @@ register RAY *r; FVECT pnorm; double cos2; COLOR trans, refl; - double transbright; double d, r1; RAY p; register int i; @@ -61,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); @@ -80,7 +80,6 @@ register RAY *r; d = colval(mcolor, i); colval(trans,i) = (1.0-r1)*(1.0-r1)*d / (1.0 - r1*r1*d*d); } - transbright = -FTINY; /* transmitted ray */ if (rayorigin(&p, r, TRANS, bright(trans)) == 0) { VCOPY(p.rdir, r->rdir); @@ -88,8 +87,8 @@ register RAY *r; multcolor(p.rcol, r->pcol); /* modify */ multcolor(p.rcol, trans); addcolor(r->rcol, p.rcol); - transbright = bright(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 */ @@ -107,7 +106,5 @@ register RAY *r; rayvalue(&p); multcolor(p.rcol, refl); addcolor(r->rcol, p.rcol); - if (bright(p.rcol) > transbright) - r->rt = r->rot + p.rt; } }