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.29 by greg, Tue Jun 25 14:06:12 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 36 | Line 40 | double  dstrpix = 0.67;                        /* square pixel distribution
40   double  dstrsrc = 0.0;                  /* square source distribution */
41   double  shadthresh = .05;               /* shadow threshold */
42   double  shadcert = .5;                  /* shadow certainty */
43 + int  directrelay = 0;                   /* number of source relays */
44 + int  vspretest = 512;                   /* virtual source pretest density */
45  
46   int  maxdepth = 6;                      /* maximum recursion depth */
47   double  minweight = 5e-3;               /* minimum ray weight */
# Line 60 | Line 66 | extern long  tstart;                   /* starting time */
66  
67   extern long  nrays;                     /* number of rays traced */
68  
69 < #define  MAXDIV         32              /* maximum sample size */
69 > #define  MAXDIV         15              /* maximum sample size */
70  
71   #define  pixjitter()    (.5+dstrpix*(.5-frandom()))
72  
# Line 122 | Line 128 | char  *zfile, *oldfile;
128                                          /* check sampling */
129          if (psample < 1)
130                  psample = 1;
131 <        else if (psample > MAXDIV)
131 >        else if (psample > MAXDIV) {
132 >                sprintf(errmsg, "pixel sampling reduced from %d to %d",
133 >                                psample, MAXDIV);
134 >                error(WARNING, errmsg);
135                  psample = MAXDIV;
136 +        }
137                                          /* allocate scanlines */
138          for (i = 0; i <= psample; i++) {
139                  scanbar[i] = (COLOR *)malloc(hresolu*sizeof(COLOR));
# Line 333 | Line 343 | pixvalue(col, x, y)            /* compute pixel value */
343   COLOR  col;                     /* returned color */
344   int  x, y;                      /* pixel position */
345   {
346 <        static RAY  thisray;    /* our ray for this pixel */
346 >        static RAY  thisray;
347  
348          if (viewray(thisray.rorg, thisray.rdir, &ourview,
349                          (x+pixjitter())/hresolu, (y+pixjitter())/vresolu) < 0) {
# Line 342 | Line 352 | int  x, y;                     /* pixel position */
352          }
353  
354          rayorigin(&thisray, NULL, PRIMARY, 1.0);
355 <        
355 >
356 >        samplendx = 3*y + x;                    /* set pixel index */
357 >
358          rayvalue(&thisray);                     /* trace ray */
359  
360          copycolor(col, thisray.rcol);           /* return color */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines