--- ray/src/rt/dielectric.c 1992/10/02 16:17:04 2.2 +++ ray/src/rt/dielectric.c 1993/03/08 12:37:15 2.5 @@ -16,6 +16,7 @@ static char SCCSid[] = "$SunId$ LBL"; #ifdef DISPERSE #include "source.h" +static disperse(); #endif /* @@ -65,8 +66,6 @@ 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 */ @@ -128,7 +127,7 @@ register RAY *r; if (m->otype != MAT_DIELECTRIC || r->rod > 0.0 || r->crtype & SHADOW - || directinvis + || !directvis || m->oargs.farg[4] == 0.0 || !disperse(m, r, p.rdir, trans)) #endif @@ -137,6 +136,8 @@ register RAY *r; multcolor(mcolor, r->pcol); /* modify */ scalecolor(p.rcol, trans); addcolor(r->rcol, p.rcol); + if (nratio >= 1.0-FTINY && nratio <= 1.0+FTINY) + r->rt = r->rot + p.rt; } } }