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

Comparing ray/src/cv/bsdf2rad.c (file contents):
Revision 2.4 by greg, Thu Nov 21 20:09:26 2013 UTC vs.
Revision 2.7 by greg, Thu Feb 20 09:21:32 2014 UTC

# Line 10 | Line 10 | static const char RCSid[] = "$Id$";
10   #include <string.h>
11   #include <stdlib.h>
12   #include <math.h>
13 + #include "rtprocess.h"
14   #include "bsdfrep.h"
15  
16   const float     colarr[6][3] = {
# Line 90 | Line 91 | main(int argc, char *argv[])
91   #ifdef DEBUG
92          fprintf(stderr, "Minimum BSDF set to %.4f\n", bsdf_min);
93   #endif
94 <        min_log = log(bsdf_min*.5);
94 >        min_log = log(bsdf_min*.5 + 1e-5);
95                                                  /* output BSDF rep. */
96          for (n = 0; (n < 6) & (2*n+3 < argc); n++) {
97                  double  theta = atof(argv[2*n+2]);
# Line 130 | Line 131 | main(int argc, char *argv[])
131                          for (i = 0; i < rbf->nrbf; i++) {
132                                  ovec_from_pos(odir, rbf->rbfa[i].gx, rbf->rbfa[i].gy);
133                                  bsdf = eval_rbfrep(rbf, odir) / (output_orient*odir[2]);
134 <                                bsdf = log(bsdf) - min_log;
134 >                                bsdf = log(bsdf + 1e-5) - min_log;
135                                  printf("pmat sphere p%d\n0\n0\n4 %f %f %f %f\n",
136                                          i+1, odir[0]*bsdf, odir[1]*bsdf, odir[2]*bsdf,
137                                                  .007*bsdf);
# Line 155 | Line 156 | main(int argc, char *argv[])
156                          } else
157                                  bsdf = eval_rbfrep(rbf, odir) /
158                                                  (output_orient*odir[2]);
159 <                        bsdf = log(bsdf) - min_log;
159 >                        bsdf = log(bsdf + 1e-5) - min_log;
160                          fprintf(fp, "%.8e %.8e %.8e\n",
161                                          odir[0]*bsdf, odir[1]*bsdf, odir[2]*bsdf);
162                      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines