--- ray/src/rt/normal.c 1992/01/14 16:16:45 2.5 +++ ray/src/rt/normal.c 1992/01/15 11:02:40 2.6 @@ -192,7 +192,10 @@ register RAY *r; colval(nd.scolor,i) += (1.0-colval(nd.scolor,i))*dtmp; nd.rspec += (1.0-nd.rspec)*dtmp; /* check threshold */ - if (nd.rspec <= specthresh+FTINY) + if (specthresh > FTINY && + ((specthresh >= 1.-FTINY || + specthresh + (.1 - .2*urand(8199+samplendx)) + > nd.rspec))) nd.specfl |= SP_RBLT; /* compute reflected ray */ for (i = 0; i < 3; i++) @@ -216,7 +219,11 @@ register RAY *r; if (nd.tspec > FTINY) { nd.specfl |= SP_TRAN; /* check threshold */ - if (nd.tspec <= specthresh+FTINY) + if (specthresh > FTINY && + ((specthresh >= 1.-FTINY || + specthresh + + (.1 - .2*urand(7241+samplendx)) + > nd.tspec))) nd.specfl |= SP_TBLT; if (r->crtype & SHADOW || DOT(r->pert,r->pert) <= FTINY*FTINY) {