--- ray/src/rt/rpict.c 1991/04/09 09:31:01 1.24 +++ ray/src/rt/rpict.c 1991/06/19 16:36:34 1.27 @@ -24,6 +24,10 @@ static char SCCSid[] = "$SunId$ LBL"; #include "random.h" +int dimlist[MAXDIM]; /* sampling dimensions */ +int ndims = 0; /* number of sampling dimensions */ +int samplendx; /* sample index number */ + VIEW ourview = STDVIEW; /* view parameters */ int hresolu = 512; /* horizontal resolution */ int vresolu = 512; /* vertical resolution */ @@ -36,6 +40,7 @@ double dstrpix = 0.67; /* square pixel distribution double dstrsrc = 0.0; /* square source distribution */ double shadthresh = .05; /* shadow threshold */ double shadcert = .5; /* shadow certainty */ +int directrelay = 0; /* number of source relays */ int maxdepth = 6; /* maximum recursion depth */ double minweight = 5e-3; /* minimum ray weight */ @@ -60,7 +65,7 @@ extern long tstart; /* starting time */ extern long nrays; /* number of rays traced */ -#define MAXDIV 32 /* maximum sample size */ +#define MAXDIV 15 /* maximum sample size */ #define pixjitter() (.5+dstrpix*(.5-frandom())) @@ -122,8 +127,12 @@ char *zfile, *oldfile; /* check sampling */ if (psample < 1) psample = 1; - else if (psample > MAXDIV) + else if (psample > MAXDIV) { + sprintf(errmsg, "pixel sampling reduced from %d to %d", + psample, MAXDIV); + error(WARNING, errmsg); psample = MAXDIV; + } /* allocate scanlines */ for (i = 0; i <= psample; i++) { scanbar[i] = (COLOR *)malloc(hresolu*sizeof(COLOR)); @@ -333,7 +342,7 @@ pixvalue(col, x, y) /* compute pixel value */ COLOR col; /* returned color */ int x, y; /* pixel position */ { - static RAY thisray; /* our ray for this pixel */ + static RAY thisray; if (viewray(thisray.rorg, thisray.rdir, &ourview, (x+pixjitter())/hresolu, (y+pixjitter())/vresolu) < 0) { @@ -342,7 +351,9 @@ int x, y; /* pixel position */ } rayorigin(&thisray, NULL, PRIMARY, 1.0); - + + samplendx = 3*y + x; /* set pixel index */ + rayvalue(&thisray); /* trace ray */ copycolor(col, thisray.rcol); /* return color */