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.25 by greg, Fri Jan 12 17:29:10 2024 UTC

# Line 109 | Line 109 | main(
109                          break;
110                  case 'c':                       /* repeat count */
111                          repeatcnt = atoi(argv[++i]);
112 +                        if (repeatcnt < 1) repeatcnt = 1;
113                          break;
114                  case 'p':                       /* pixel aspect or jitter */
115                          if (argv[i][2] == 'a')
# Line 154 | Line 155 | main(
155                                  (vw.vaft > FTINY) ? " -ld+" : "");
156                  return(0);
157          }
158 +        if ((repeatcnt > 1) & (pj > FTINY))
159 +                initurand(1024);
160          if (fromstdin)
161                  pix2rays(stdin);
162          else
# Line 172 | Line 175 | jitterloc(
175          RREAL   loc[2]
176   )
177   {
178 <        if (pj > FTINY) {
179 <                loc[0] += pj*(.5 - frandom())/rs.xr;
180 <                loc[1] += pj*(.5 - frandom())/rs.yr;
181 <        }
178 >        static int      nsamp;
179 >        double          xyr[2];
180 >
181 >        if (pj <= FTINY)
182 >                return;
183 >
184 >        if (repeatcnt == 1) {
185 >                xyr[0] = frandom();
186 >                xyr[1] = frandom();
187 >        } else                          /* stratify samples */
188 >                multisamp(xyr, 2, urand(nsamp++));
189 >
190 >        loc[0] += pj*(.5 - xyr[0])/rs.xr;
191 >        loc[1] += pj*(.5 - xyr[1])/rs.yr;
192   }
193  
194  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines