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.7 by greg, Mon Oct 21 18:33:15 2013 UTC vs.
Revision 2.8 by greg, Tue Oct 22 04:29:27 2013 UTC

# Line 145 | Line 145 | add_pabopto_inp(const int i)
145          return(1);
146   }
147  
148 < #if 1
148 > #ifndef TEST_MAIN
149   /* Read in PAB-Opto BSDF files and output RBF interpolant */
150   int
151   main(int argc, char *argv[])
# Line 222 | Line 222 | main(int argc, char *argv[])
222              for (j = 0; j < GRIDRES; j++)
223                  if (dsf_grid[i][j].nval > 0) {
224                          ovec_from_pos(dir, i, j);
225 <                        bsdf = dsf_grid[i][j].vsum/(dsf_grid[i][j].nval*dir[2]);
225 >                        bsdf = dsf_grid[i][j].vsum /
226 >                                (dsf_grid[i][j].nval*output_orient*dir[2]);
227                          if (bsdf <= bsdf_min*.6)
228                                  continue;
229                          bsdf = log(bsdf) - min_log;
# Line 238 | Line 239 | main(int argc, char *argv[])
239          sprintf(buf, "gensurf tgreen bsdf - - - %d %d", GRIDRES-1, GRIDRES-1);
240          pfp = popen(buf, "w");
241          if (pfp == NULL) {
242 <                fputs(buf, stderr);
242 <                fputs(": cannot start command\n", stderr);
242 >                fprintf(stderr, "%s: cannot open '| %s'\n", argv[0], buf);
243                  return(1);
244          }
245          for (i = 0; i < GRIDRES; i++)
246              for (j = 0; j < GRIDRES; j++) {
247                  ovec_from_pos(dir, i, j);
248 <                bsdf = eval_rbfrep(dsf_list, dir) / dir[2];
248 >                bsdf = eval_rbfrep(dsf_list, dir) / (output_orient*dir[2]);
249                  bsdf = log(bsdf) - min_log;
250                  fprintf(pfp, "%.8e %.8e %.8e\n",
251                                  dir[0]*bsdf, dir[1]*bsdf, dir[2]*bsdf);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines