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

Comparing ray/src/rt/p_func.c (file contents):
Revision 2.11 by greg, Wed Dec 13 23:26:16 2023 UTC vs.
Revision 2.12 by greg, Sun Jan 7 18:04:16 2024 UTC

# Line 105 | Line 105 | p_specfunc(                    /* compute spectral pattern */
105          SCOLOR  scval;
106          double  wl, wlmin, wlmax, wlstep;
107          int     ns, i;
108        MFUNC   *mf;
108  
109          if ((m->oargs.nsargs < 2) | (m->oargs.nfargs < 2))
110                  objerror(m, USER, "bad # arguments");
# Line 123 | Line 122 | p_specfunc(                    /* compute spectral pattern */
122                  return(0);
123          }
124          wlstep = (wlmax - wlmin)/(double)MAXCSAMP;
125 <        mf = getfunc(m, 1, 0, 0);
125 >        getfunc(m, 1, 0, 0);
126          setfunc(m, r);
127          errno = 0;
128          ns = (wlmax - wlmin)/wlstep + .1;
129          wl = wlmax - .5*wlstep;
130          for (i = ns; i-- > 0; wl -= wlstep) {
131 <                double  ws = wl + 0.9*(1.-frandom())*wlstep;
131 >                double  ws = wl + 0.9*(.5-frandom())*wlstep;
132                  scsamp[i] = funvalue(m->oargs.sarg[0], 1, &ws);
133                  if ((errno == EDOM) | (errno == ERANGE)) {
134                          objerror(m, WARNING, "compute error");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines