--- ray/src/rt/dielectric.c 1991/11/12 17:09:55 2.1 +++ ray/src/rt/dielectric.c 1994/01/13 09:45:08 2.7 @@ -16,6 +16,8 @@ static char SCCSid[] = "$SunId$ LBL"; #ifdef DISPERSE #include "source.h" +static disperse(); +static int lambda(); #endif /* @@ -53,7 +55,6 @@ m_dielectric(m, r) /* color a ray which hit something OBJREC *m; register RAY *r; { - double sqrt(), pow(); double cos1, cos2, nratio; COLOR mcolor; double mabsorp; @@ -66,8 +67,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 */ @@ -129,7 +128,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 @@ -138,6 +137,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; } } } @@ -156,6 +157,8 @@ register RAY *r; } multcolor(r->rcol, mcolor); /* multiply by transmittance */ + + return(1); } @@ -168,7 +171,6 @@ RAY *r; FVECT vt; double tr; { - double sqrt(); RAY sray, *entray; FVECT v1, v2, n1, n2; FVECT dv, v2Xdv;