--- ray/src/rt/rpict.c 1991/09/19 13:55:53 1.32 +++ ray/src/rt/rpict.c 1991/10/21 12:57:57 1.35 @@ -15,9 +15,9 @@ static char SCCSid[] = "$SunId$ LBL"; #ifdef BSD #include #include -#else -#include #endif + +#include #include #include "view.h" @@ -40,9 +40,10 @@ 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 directrelay = 1; /* number of source relays */ int vspretest = 512; /* virtual source pretest density */ int directinvis = 0; /* sources invisible? */ +double srcsizerat = .25; /* maximum ratio source size/dist. */ int maxdepth = 6; /* maximum recursion depth */ double minweight = 5e-3; /* minimum ray weight */ @@ -122,6 +123,7 @@ char *zfile, *oldfile; float *zbar[MAXDIV+1]; /* z values */ int ypos; /* current scanline */ int ystep; /* current y step size */ + int hstep; /* h step size */ int zfd; COLOR *colptr; float *zptr; @@ -172,8 +174,9 @@ char *zfile, *oldfile; #endif signal(SIGALRM, report); ypos = vresolu-1 - i; - fillscanline(scanbar[0], zbar[0], hresolu, ypos, psample); - ystep = psample; + hstep = (psample*140+49)/99; /* quincunx sampling */ + ystep = (psample*99+70)/140; + fillscanline(scanbar[0], zbar[0], hresolu, ypos, hstep); /* compute scanlines */ for (ypos -= ystep; ypos > -ystep; ypos -= ystep) { /* bottom adjust? */ @@ -188,7 +191,7 @@ char *zfile, *oldfile; zbar[ystep] = zbar[0]; zbar[0] = zptr; /* fill base line */ - fillscanline(scanbar[0], zbar[0], hresolu, ypos, psample); + fillscanline(scanbar[0], zbar[0], hresolu, ypos, hstep); /* fill bar */ fillscanbar(scanbar, zbar, hresolu, ypos, ystep); /* write it out */ @@ -243,14 +246,15 @@ register COLOR *scanline; register float *zline; int xres, y, xstep; { + static int nc = 0; /* number of calls */ int b = xstep; double z; register int i; z = pixvalue(scanline[0], 0, y); if (zline) zline[0] = z; - - for (i = xstep; i < xres-1+xstep; i += xstep) { + /* zig-zag start for quincunx pattern */ + for (i = nc++ & 1 ? xstep/2 : xstep; i < xres-1+xstep; i += xstep) { if (i >= xres) { xstep += xres-1-i; i = xres-1;