57 |
|
double cos1, cos2, nratio; |
58 |
|
COLOR mcolor; |
59 |
|
double mabsorp; |
60 |
< |
double refl, trans; |
60 |
> |
double refl, trans, transbright; |
61 |
|
FVECT dnorm; |
62 |
|
double d1, d2; |
63 |
|
RAY p; |
115 |
|
|
116 |
|
refl /= 2.0; |
117 |
|
trans = 1.0 - refl; |
118 |
+ |
transbright = -FTINY; |
119 |
|
|
120 |
|
if (rayorigin(&p, r, REFRACTED, mabsorp*trans) == 0) { |
121 |
|
|
136 |
|
multcolor(mcolor, r->pcol); /* modify */ |
137 |
|
scalecolor(p.rcol, trans); |
138 |
|
addcolor(r->rcol, p.rcol); |
139 |
+ |
transbright = bright(p.rcol); |
140 |
|
r->rt = r->rot + p.rt; |
141 |
|
} |
142 |
|
} |
153 |
|
|
154 |
|
scalecolor(p.rcol, refl); /* color contribution */ |
155 |
|
addcolor(r->rcol, p.rcol); |
156 |
< |
if (refl > trans) |
156 |
> |
if (bright(p.rcol) > transbright) |
157 |
|
r->rt = r->rot + p.rt; |
158 |
|
} |
159 |
|
|