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

Comparing ray/src/cv/bsdfrbf.c (file contents):
Revision 2.27 by greg, Fri Jan 29 16:21:55 2016 UTC vs.
Revision 2.30 by greg, Tue Dec 6 23:39:54 2016 UTC

# Line 31 | Line 31 | static const char RCSid[] = "$Id$";
31   #ifndef RSCA
32   #define RSCA            2.0             /* radius scaling factor (empirical) */
33   #endif
34 + #ifndef MAXSLOPE
35 + #define MAXSLOPE        200.0           /* maximum slope for smooth region */
36 + #endif
37   #ifndef SMOOTH_MSE
38   #define SMOOTH_MSE      5e-5            /* acceptable mean squared error */
39   #endif
# Line 137 | Line 140 | add_bsdf_data(double theta_out, double phi_out, const
140          dsf_grid[pos[0]][pos[1]].sum.n++;
141                                          /* add in X and Z values */
142          if (rbf_colorimetry == RBCtristimulus) {
143 <                spec_grid[0][pos[0]][pos[1]] += val[0];
144 <                spec_grid[1][pos[0]][pos[1]] += val[2];
143 >                spec_grid[0][pos[0]][pos[1]] += cfact * val[0];
144 >                spec_grid[1][pos[0]][pos[1]] += cfact * val[2];
145          }
146   }
147  
# Line 209 | Line 212 | smooth_region(int x0, int x1, int y0, int y1)
212                  return(1);              /* colinear values */
213          A = DOT(rMtx[0], xvec);
214          B = DOT(rMtx[1], xvec);
215 +        if (A*A + B*B > MAXSLOPE*MAXSLOPE)      /* too steep? */
216 +                return(0);
217          C = DOT(rMtx[2], xvec);
218          sqerr = 0.0;                    /* compute mean squared error */
219          for (x = x0; x < x1; x++)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines