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

Comparing ray/src/cv/pabopto2bsdf.c (file contents):
Revision 2.15 by greg, Sat Mar 8 01:05:00 2014 UTC vs.
Revision 2.17 by greg, Tue Mar 18 19:08:24 2014 UTC

# Line 25 | Line 25 | typedef struct {
25          long            dstart;         /* data start offset in file */
26   } PGINPUT;
27  
28 + const double    ANGLE_EPS = 180./2./GRIDRES;
29 +
30   PGINPUT         *inpfile;       /* input files sorted by incidence */
31   int             ninpfiles;      /* number of input files */
32  
# Line 35 | Line 37 | cmp_inang(const void *p1, const void *p2)
37          const PGINPUT   *inp1 = (const PGINPUT *)p1;
38          const PGINPUT   *inp2 = (const PGINPUT *)p2;
39          
40 <        if (inp1->theta > inp2->theta+FTINY)
40 >        if (inp1->theta > inp2->theta+ANGLE_EPS)
41                  return(1);
42 <        if (inp1->theta < inp2->theta-FTINY)
42 >        if (inp1->theta < inp2->theta-ANGLE_EPS)
43                  return(-1);
44 <        if (inp1->phi > inp2->phi+FTINY)
44 >        if (inp1->phi > inp2->phi+ANGLE_EPS)
45                  return(1);
46 <        if (inp1->phi < inp2->phi-FTINY)
46 >        if (inp1->phi < inp2->phi-ANGLE_EPS)
47                  return(-1);
48          return(0);
49   }
# Line 226 | Line 228 | main(int argc, char *argv[])
228          n = 0;
229          for (i = 0; i < GRIDRES; i++)
230              for (j = 0; j < GRIDRES; j++)
231 <                if (dsf_grid[i][j].nval > 0) {
231 >                if (dsf_grid[i][j].sum.n > 0) {
232                          ovec_from_pos(dir, i, j);
233 <                        bsdf = dsf_grid[i][j].vsum /
234 <                                (dsf_grid[i][j].nval*output_orient*dir[2]);
233 >                        bsdf = dsf_grid[i][j].sum.v /
234 >                                (dsf_grid[i][j].sum.n*output_orient*dir[2]);
235                          if (bsdf <= bsdf_min*.6)
236                                  continue;
237                          bsdf = log(bsdf + 1e-5) - min_log;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines