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

Comparing ray/src/util/vwrays.c (file contents):
Revision 3.24 by greg, Sat Apr 9 17:18:08 2022 UTC vs.
Revision 3.26 by greg, Tue Jun 3 21:31:51 2025 UTC

# Line 37 | Line 37 | int    unbuffered = 0;
37  
38   int     repeatcnt = 1;
39  
40 char    *progname;
40  
42
41   int
42   main(
43          int     argc,
# Line 50 | Line 48 | main(
48          int     rval, getdim = 0;
49          int     i;
50  
51 <        progname = argv[0];
51 >        fixargv0(argv[0]);              /* sets global progname */
52          if (argc < 2)
53                  goto userr;
54          for (i = 1; i < argc && argv[i][0] == '-'; i++)
# Line 109 | Line 107 | main(
107                          break;
108                  case 'c':                       /* repeat count */
109                          repeatcnt = atoi(argv[++i]);
110 +                        if (repeatcnt < 1) repeatcnt = 1;
111                          break;
112                  case 'p':                       /* pixel aspect or jitter */
113                          if (argv[i][2] == 'a')
# Line 154 | Line 153 | main(
153                                  (vw.vaft > FTINY) ? " -ld+" : "");
154                  return(0);
155          }
156 +        if ((repeatcnt > 1) & (pj > FTINY))
157 +                initurand(1024);
158          if (fromstdin)
159                  pix2rays(stdin);
160          else
# Line 172 | Line 173 | jitterloc(
173          RREAL   loc[2]
174   )
175   {
176 <        if (pj > FTINY) {
177 <                loc[0] += pj*(.5 - frandom())/rs.xr;
178 <                loc[1] += pj*(.5 - frandom())/rs.yr;
179 <        }
176 >        static int      nsamp;
177 >        double          xyr[2];
178 >
179 >        if (pj <= FTINY)
180 >                return;
181 >
182 >        if (repeatcnt == 1) {
183 >                xyr[0] = frandom();
184 >                xyr[1] = frandom();
185 >        } else                          /* stratify samples */
186 >                multisamp(xyr, 2, urand(nsamp++));
187 >
188 >        loc[0] += pj*(.5 - xyr[0])/rs.xr;
189 >        loc[1] += pj*(.5 - xyr[1])/rs.yr;
190   }
191  
192  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines