--- ray/src/rt/glass.c 1989/02/02 10:41:24 1.1 +++ ray/src/rt/glass.c 1990/03/27 11:40:00 1.3 @@ -80,13 +80,15 @@ register RAY *r; colval(trans,i) = (1.0-r1)*(1.0-r1)*d / (1.0 - r1*r1*d*d); } /* transmitted ray */ - if (rayorigin(&p, r, TRANS, intens(trans)) == 0) { + if (rayorigin(&p, r, TRANS, bright(trans)) == 0) { VCOPY(p.rdir, r->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 (r->crtype & SHADOW) /* skip reflected ray */ return; /* compute reflectance */ @@ -96,11 +98,13 @@ register RAY *r; colval(refl,i) = r1 * (1.0 + (1.0-2.0*r1)*d) / (1.0 - r1*r1*d); } /* reflected ray */ - if (rayorigin(&p, r, REFLECTED, intens(refl)) == 0) { + if (rayorigin(&p, r, REFLECTED, bright(refl)) == 0) { for (i = 0; i < 3; i++) p.rdir[i] = r->rdir[i] + 2.0*pdot*pnorm[i]; rayvalue(&p); multcolor(p.rcol, refl); addcolor(r->rcol, p.rcol); + if (bright(refl) > bright(trans)) + r->rt = r->rot + p.rt; } }