--- ray/src/rt/virtuals.c 1991/08/02 10:30:27 1.20 +++ ray/src/rt/virtuals.c 1991/08/13 12:16:43 1.23 @@ -19,8 +19,8 @@ static char SCCSid[] = "$SunId$ LBL"; #include "random.h" -#define MINSAMPLES 5 /* minimum number of pretest samples */ -#define STESTMAX 30 /* maximum seeks per sample */ +#define MINSAMPLES 16 /* minimum number of pretest samples */ +#define STESTMAX 32 /* maximum seeks per sample */ double getdisk(); @@ -44,8 +44,10 @@ markvirtuals() /* find and mark virtual sources */ if (!isvlight(objptr(o->omod)->otype)) continue; if (sfun[o->otype].of == NULL || - sfun[o->otype].of->getpleq == NULL) - objerror(o, USER, "illegal material"); + sfun[o->otype].of->getpleq == NULL) { + objerror(o,WARNING,"secondary sources not supported"); + continue; + } if (nvobjects == 0) vobject = (OBJECT *)malloc(sizeof(OBJECT)); else @@ -285,8 +287,7 @@ register int sn; /* target source number */ getplaneq(onorm, o); /* set number of rays to sample */ if (source[sn].sflags & SDISTANT) { - n = (2./3.*PI*PI)*or2/(thescene.cusize*thescene.cusize)* - vspretest + .5; + n = 4.*or2/(thescene.cusize*thescene.cusize)*vspretest + .5; infront = DOT(onorm, source[sn].sloc) > 0.; } else { for (i = 0; i < 3; i++) @@ -317,9 +318,9 @@ register int sn; /* target source number */ #endif return(f); /* too small a target! */ } + peano(offsdir, 3, urand(931*i+5827+ssn), .005); for (i = 0; i < 3; i++) - offsdir[i] = or*(1. - - 2.*urand(urind(931*i+5827,ssn))); + offsdir[i] = or*(1. - 2.*offsdir[i]); ssn++; for (i = 0; i < 3; i++) sr.rorg[i] = oc[i] + offsdir[i];