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.6 by greg, Wed Sep 25 05:03:10 2013 UTC vs.
Revision 2.7 by greg, Wed Sep 25 17:42:45 2013 UTC

# Line 17 | Line 17 | static const char RCSid[] = "$Id$";
17   #ifndef RSCA
18   #define RSCA            2.7             /* radius scaling factor (empirical) */
19   #endif
20 + #ifndef MAXFRAC
21 + #define MAXFRAC         0.5             /* maximum contribution to neighbor */
22 + #endif
23 + #ifndef NNEIGH
24 + #define NNEIGH          10              /* number of neighbors to consider */
25 + #endif
26                                  /* our loaded grid for this incident angle */
27   GRIDVAL                 dsf_grid[GRIDRES][GRIDRES];
28  
# Line 245 | Line 251 | get_neighbors(int neigh[][2], int n, const int i, cons
251   static int
252   adj_coded_radius(const int i, const int j)
253   {
248        const double    max_frac = 0.33;
254          const double    rad0 = R2ANG(dsf_grid[i][j].crad);
255          double          currad = RSCA * rad0;
256 <        int             neigh[5][2];
256 >        int             neigh[NNEIGH][2];
257          int             n;
258          FVECT           our_dir;
259  
260          ovec_from_pos(our_dir, i, j);
261 <        n = get_neighbors(neigh, 5, i, j);
261 >        n = get_neighbors(neigh, NNEIGH, i, j);
262          while (n--) {
263                  FVECT   their_dir;
264                  double  max_ratio, rad_ok2;
265                                                  /* check our value at neighbor */
266                  ovec_from_pos(their_dir, neigh[n][0], neigh[n][1]);
267 <                max_ratio = max_frac * dsf_grid[neigh[n][0]][neigh[n][1]].vsum
267 >                max_ratio = MAXFRAC * dsf_grid[neigh[n][0]][neigh[n][1]].vsum
268                                  / dsf_grid[i][j].vsum;
269                  if (max_ratio >= 1)
270                          continue;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines