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.27 by greg, Wed Jun 19 16:36:34 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  
45   int  maxdepth = 6;                      /* maximum recursion depth */
46   double  minweight = 5e-3;               /* minimum ray weight */
# Line 60 | Line 65 | extern long  tstart;                   /* starting time */
65  
66   extern long  nrays;                     /* number of rays traced */
67  
68 < #define  MAXDIV         32              /* maximum sample size */
68 > #define  MAXDIV         15              /* maximum sample size */
69  
70   #define  pixjitter()    (.5+dstrpix*(.5-frandom()))
71  
# Line 122 | Line 127 | char  *zfile, *oldfile;
127                                          /* check sampling */
128          if (psample < 1)
129                  psample = 1;
130 <        else if (psample > MAXDIV)
130 >        else if (psample > MAXDIV) {
131 >                sprintf(errmsg, "pixel sampling reduced from %d to %d",
132 >                                psample, MAXDIV);
133 >                error(WARNING, errmsg);
134                  psample = MAXDIV;
135 +        }
136                                          /* allocate scanlines */
137          for (i = 0; i <= psample; i++) {
138                  scanbar[i] = (COLOR *)malloc(hresolu*sizeof(COLOR));
# Line 333 | Line 342 | pixvalue(col, x, y)            /* compute pixel value */
342   COLOR  col;                     /* returned color */
343   int  x, y;                      /* pixel position */
344   {
345 <        static RAY  thisray;    /* our ray for this pixel */
345 >        static RAY  thisray;
346  
347          if (viewray(thisray.rorg, thisray.rdir, &ourview,
348                          (x+pixjitter())/hresolu, (y+pixjitter())/vresolu) < 0) {
# Line 342 | Line 351 | int  x, y;                     /* pixel position */
351          }
352  
353          rayorigin(&thisray, NULL, PRIMARY, 1.0);
354 <        
354 >
355 >        samplendx = 3*y + x;                    /* set pixel index */
356 >
357          rayvalue(&thisray);                     /* trace ray */
358  
359          copycolor(col, thisray.rcol);           /* return color */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines