--- ray/src/rt/dielectric.c 1990/05/30 19:56:58 1.4 +++ ray/src/rt/dielectric.c 1990/10/15 20:39:30 1.5 @@ -57,7 +57,7 @@ register RAY *r; double cos1, cos2, nratio; COLOR mcolor; double mabsorp; - double refl, trans, transbright; + double refl, trans; FVECT dnorm; double d1, d2; RAY p; @@ -66,6 +66,8 @@ register RAY *r; if (m->oargs.nfargs != (m->otype==MAT_DIELECTRIC ? 5 : 8)) objerror(m, USER, "bad arguments"); + r->rt = r->rot; /* just use ray length */ + raytexture(r, m->omod); /* get modifiers */ cos1 = raynormal(dnorm, r); /* cosine of theta1 */ @@ -115,7 +117,6 @@ register RAY *r; refl /= 2.0; trans = 1.0 - refl; - transbright = -FTINY; if (rayorigin(&p, r, REFRACTED, mabsorp*trans) == 0) { @@ -136,8 +137,6 @@ register RAY *r; multcolor(mcolor, r->pcol); /* modify */ scalecolor(p.rcol, trans); addcolor(r->rcol, p.rcol); - transbright = bright(p.rcol); - r->rt = r->rot + p.rt; } } } @@ -153,8 +152,6 @@ register RAY *r; scalecolor(p.rcol, refl); /* color contribution */ addcolor(r->rcol, p.rcol); - if (bright(p.rcol) > transbright) - r->rt = r->rot + p.rt; } multcolor(r->rcol, mcolor); /* multiply by transmittance */