ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rpict.c
(Generate patch)

Comparing ray/src/rt/rpict.c (file contents):
Revision 1.24 by greg, Tue Apr 9 09:31:01 1991 UTC vs.
Revision 1.26 by greg, Tue Jun 18 10:27:16 1991 UTC

# Line 24 | Line 24 | static char SCCSid[] = "$SunId$ LBL";
24  
25   #include  "random.h"
26  
27 + int  dimlist[MAXDIM];                   /* sampling dimensions */
28 + int  ndims = 0;                         /* number of sampling dimensions */
29 + int  samplendx;                         /* sample index number */
30 +
31   VIEW  ourview = STDVIEW;                /* view parameters */
32   int  hresolu = 512;                     /* horizontal resolution */
33   int  vresolu = 512;                     /* vertical resolution */
# Line 60 | Line 64 | extern long  tstart;                   /* starting time */
64  
65   extern long  nrays;                     /* number of rays traced */
66  
67 < #define  MAXDIV         32              /* maximum sample size */
67 > #define  MAXDIV         15              /* maximum sample size */
68  
69   #define  pixjitter()    (.5+dstrpix*(.5-frandom()))
70  
# Line 122 | Line 126 | char  *zfile, *oldfile;
126                                          /* check sampling */
127          if (psample < 1)
128                  psample = 1;
129 <        else if (psample > MAXDIV)
129 >        else if (psample > MAXDIV) {
130 >                sprintf(errmsg, "pixel sampling reduced from %d to %d",
131 >                                psample, MAXDIV);
132 >                error(WARNING, errmsg);
133                  psample = MAXDIV;
134 +        }
135                                          /* allocate scanlines */
136          for (i = 0; i <= psample; i++) {
137                  scanbar[i] = (COLOR *)malloc(hresolu*sizeof(COLOR));
# Line 333 | Line 341 | pixvalue(col, x, y)            /* compute pixel value */
341   COLOR  col;                     /* returned color */
342   int  x, y;                      /* pixel position */
343   {
344 <        static RAY  thisray;    /* our ray for this pixel */
344 >        static RAY  thisray;
345  
346          if (viewray(thisray.rorg, thisray.rdir, &ourview,
347                          (x+pixjitter())/hresolu, (y+pixjitter())/vresolu) < 0) {
# Line 342 | Line 350 | int  x, y;                     /* pixel position */
350          }
351  
352          rayorigin(&thisray, NULL, PRIMARY, 1.0);
353 <        
353 >
354 >        samplendx = 3*y + x;                    /* set pixel index */
355 >
356          rayvalue(&thisray);                     /* trace ray */
357  
358          copycolor(col, thisray.rcol);           /* return color */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines