192 |
|
colval(nd.scolor,i) += (1.0-colval(nd.scolor,i))*dtmp; |
193 |
|
nd.rspec += (1.0-nd.rspec)*dtmp; |
194 |
|
/* check threshold */ |
195 |
< |
if (nd.rspec <= specthresh+FTINY) |
195 |
> |
if (specthresh > FTINY && |
196 |
> |
((specthresh >= 1.-FTINY || |
197 |
> |
specthresh + (.1 - .2*urand(8199+samplendx)) |
198 |
> |
> nd.rspec))) |
199 |
|
nd.specfl |= SP_RBLT; |
200 |
|
/* compute reflected ray */ |
201 |
|
for (i = 0; i < 3; i++) |
219 |
|
if (nd.tspec > FTINY) { |
220 |
|
nd.specfl |= SP_TRAN; |
221 |
|
/* check threshold */ |
222 |
< |
if (nd.tspec <= specthresh+FTINY) |
222 |
> |
if (specthresh > FTINY && |
223 |
> |
((specthresh >= 1.-FTINY || |
224 |
> |
specthresh + |
225 |
> |
(.1 - .2*urand(7241+samplendx)) |
226 |
> |
> nd.tspec))) |
227 |
|
nd.specfl |= SP_TBLT; |
228 |
|
if (r->crtype & SHADOW || |
229 |
|
DOT(r->pert,r->pert) <= FTINY*FTINY) { |