--- ray/src/rt/source.c 1991/08/06 14:07:03 1.41 +++ ray/src/rt/source.c 1991/08/13 12:16:37 1.43 @@ -1,4 +1,4 @@ -/* Copyright (c) 1990 Regents of the University of California */ +/* Copyright (c) 1991 Regents of the University of California */ #ifndef lint static char SCCSid[] = "$SunId$ LBL"; @@ -140,13 +140,10 @@ register int sn; /* source number */ } if (dstrsrc > FTINY) { /* distribute source direction */ - dimlist[ndims++] = sn; - for (i = 0; i < 3; i++) { - dimlist[ndims] = i + 8831; - vd[i] = dstrsrc * source[sn].ss * - (1.0 - 2.0*urand(urind(ilhash(dimlist,ndims+1),samplendx))); - } - ndims--; + dimlist[ndims] = sn + 8831; + peano(vd, 3, urand(ilhash(dimlist,ndims+1)+samplendx), .01); + for (i = 0; i < 3; i++) + vd[i] = dstrsrc * source[sn].ss * (1. - 2.*vd[i]); if (source[sn].sflags & SFLAT) { /* project offset */ d = DOT(vd, source[sn].snorm); for (i = 0; i < 3; i++) @@ -247,6 +244,7 @@ RAY *r; /* ray that hit surface */ int (*f)(); /* direct component coefficient function */ char *p; /* data for f */ { + extern int (*trace)(); extern double pow(); register int sn; int nshadcheck, ncnts; @@ -316,6 +314,8 @@ char *p; /* data for f */ source[cntord[sn].sno].sflags & SFOLLOW )) { /* follow entire path */ raycont(&sr); + if (trace != NULL) + (*trace)(&sr); /* trace execution */ if (bright(sr.rcol) <= FTINY) continue; /* missed! */ copycolor(srccnt[cntord[sn].sno].val, sr.rcol);