--- ray/src/rt/virtuals.c 1991/08/13 12:16:43 1.23 +++ ray/src/rt/virtuals.c 1991/08/26 10:10:43 1.26 @@ -287,7 +287,8 @@ register int sn; /* target source number */ getplaneq(onorm, o); /* set number of rays to sample */ if (source[sn].sflags & SDISTANT) { - n = 4.*or2/(thescene.cusize*thescene.cusize)*vspretest + .5; + /* 32. == heuristic constant */ + n = 32.*or2/(thescene.cusize*thescene.cusize)*vspretest + .5; infront = DOT(onorm, source[sn].sloc) > 0.; } else { for (i = 0; i < 3; i++) @@ -318,7 +319,7 @@ register int sn; /* target source number */ #endif return(f); /* too small a target! */ } - peano(offsdir, 3, urand(931*i+5827+ssn), .005); + multisamp(offsdir, 3, urand(sn*931+5827+ssn)); for (i = 0; i < 3; i++) offsdir[i] = or*(1. - 2.*offsdir[i]); ssn++; @@ -348,9 +349,7 @@ register int sn; /* target source number */ nok++; /* check against obstructions */ rayclear(&sr); - sr.revf = raytrace; - rayvalue(&sr); - if (bright(sr.rcol) > FTINY) + if (!localhit(&sr, &thescene) || sr.ro == source[sn].so) nhit++; if (nhit > 0 && nhit < nok) { #ifdef DEBUG