57 |
|
double cos1, cos2, nratio; |
58 |
|
COLOR mcolor; |
59 |
|
double mabsorp; |
60 |
< |
double refl, trans, transbright; |
60 |
> |
double refl, trans; |
61 |
|
FVECT dnorm; |
62 |
|
double d1, d2; |
63 |
|
RAY p; |
66 |
|
if (m->oargs.nfargs != (m->otype==MAT_DIELECTRIC ? 5 : 8)) |
67 |
|
objerror(m, USER, "bad arguments"); |
68 |
|
|
69 |
+ |
r->rt = r->rot; /* just use ray length */ |
70 |
+ |
|
71 |
|
raytexture(r, m->omod); /* get modifiers */ |
72 |
|
|
73 |
|
cos1 = raynormal(dnorm, r); /* cosine of theta1 */ |
117 |
|
|
118 |
|
refl /= 2.0; |
119 |
|
trans = 1.0 - refl; |
118 |
– |
transbright = -FTINY; |
120 |
|
|
121 |
|
if (rayorigin(&p, r, REFRACTED, mabsorp*trans) == 0) { |
122 |
|
|
129 |
|
if (m->otype != MAT_DIELECTRIC |
130 |
|
|| r->rod > 0.0 |
131 |
|
|| r->crtype & SHADOW |
132 |
+ |
|| directinvis |
133 |
|
|| m->oargs.farg[4] == 0.0 |
134 |
|
|| !disperse(m, r, p.rdir, trans)) |
135 |
|
#endif |
138 |
|
multcolor(mcolor, r->pcol); /* modify */ |
139 |
|
scalecolor(p.rcol, trans); |
140 |
|
addcolor(r->rcol, p.rcol); |
139 |
– |
transbright = bright(p.rcol); |
140 |
– |
r->rt = r->rot + p.rt; |
141 |
|
} |
142 |
|
} |
143 |
|
} |
153 |
|
|
154 |
|
scalecolor(p.rcol, refl); /* color contribution */ |
155 |
|
addcolor(r->rcol, p.rcol); |
156 |
– |
if (bright(p.rcol) > transbright) |
157 |
– |
r->rt = r->rot + p.rt; |
156 |
|
} |
157 |
|
|
158 |
|
multcolor(r->rcol, mcolor); /* multiply by transmittance */ |