206 |
|
colval(nd.scolor,i) += (1.0-colval(nd.scolor,i))*dtmp; |
207 |
|
nd.rspec += (1.0-nd.rspec)*dtmp; |
208 |
|
/* check threshold */ |
209 |
< |
if (nd.rspec <= specthresh+FTINY) |
209 |
> |
if (specthresh > FTINY && |
210 |
> |
((specthresh >= 1.-FTINY || |
211 |
> |
specthresh + (.1 - .2*urand(8199+samplendx)) |
212 |
> |
> nd.rspec))) |
213 |
|
nd.specfl |= SP_RBLT; |
214 |
|
|
215 |
|
if (!(r->crtype & SHADOW) && nd.specfl & SP_PURE) { |
232 |
|
if (nd.tspec > FTINY) { |
233 |
|
nd.specfl |= SP_TRAN; |
234 |
|
/* check threshold */ |
235 |
< |
if (nd.tspec <= specthresh+FTINY) |
235 |
> |
if (specthresh > FTINY && |
236 |
> |
((specthresh >= 1.-FTINY || |
237 |
> |
specthresh + |
238 |
> |
(.1 - .2*urand(7241+samplendx)) |
239 |
> |
> nd.tspec))) |
240 |
|
nd.specfl |= SP_TBLT; |
241 |
|
if (r->crtype & SHADOW || |
242 |
|
DOT(r->pert,r->pert) <= FTINY*FTINY) { |