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

Comparing ray/src/cv/bsdf2ttree.c (file contents):
Revision 2.17 by greg, Fri Aug 2 20:56:19 2013 UTC vs.
Revision 2.19 by greg, Thu Oct 3 17:01:02 2013 UTC

# Line 24 | Line 24 | int                    samp_order = 6;
24   const double            ssamp_thresh = 0.35;
25                                  /* number of super-samples */
26   const int               nssamp = 100;
27 +                                /* limit on number of RBF lobes */
28 + static int              lobe_lim = 15000;
29  
30   /* Output XML prologue to stdout */
31   static void
# Line 120 | Line 122 | eval_isotropic(char *funame)
122  
123          data_prologue();                        /* begin output */
124          if (pctcull >= 0) {
125 <                sprintf(cmd, "rttree_reduce -h -a -ff -r 3 -t %f -g %d",
125 >                sprintf(cmd, "rttree_reduce%s -h -ff -r 3 -t %f -g %d",
126 >                                (input_orient>0 ^ output_orient>0) ? "" : " -a",
127                                  pctcull, samp_order);
128                  fflush(stdout);
129                  ofp = popen(cmd, "w");
# Line 142 | Line 145 | eval_isotropic(char *funame)
145                  iovec[1] = .0;
146                  iovec[2] = input_orient * sqrt(1. - iovec[0]*iovec[0]);
147                  if (funame == NULL)
148 <                        rbf = advect_rbf(iovec);
148 >                        rbf = advect_rbf(iovec, lobe_lim);
149                  for (ox = 0; ox < sqres; ox++) {
150                      float       last_bsdf = -1;
151                      for (oy = 0; oy < sqres; oy++) {
# Line 224 | Line 227 | eval_anisotropic(char *funame)
227  
228          data_prologue();                        /* begin output */
229          if (pctcull >= 0) {
230 <                sprintf(cmd, "rttree_reduce -h -a -ff -r 4 -t %f -g %d",
230 >                sprintf(cmd, "rttree_reduce%s -h -ff -r 4 -t %f -g %d",
231 >                                (input_orient>0 ^ output_orient>0) ? "" : " -a",
232                                  pctcull, samp_order);
233                  fflush(stdout);
234                  ofp = popen(cmd, "w");
# Line 246 | Line 250 | eval_anisotropic(char *funame)
250                  iovec[2] = input_orient *
251                                  sqrt(1. - iovec[0]*iovec[0] - iovec[1]*iovec[1]);
252                  if (funame == NULL)
253 <                        rbf = advect_rbf(iovec);
253 >                        rbf = advect_rbf(iovec, lobe_lim);
254                  for (ox = 0; ox < sqres; ox++) {
255                      float       last_bsdf = -1;
256                      for (oy = 0; oy < sqres; oy++) {
# Line 356 | Line 360 | main(int argc, char *argv[])
360                  case 'g':
361                          samp_order = atoi(argv[++i]);
362                          break;
363 +                case 'l':
364 +                        lobe_lim = atoi(argv[++i]);
365 +                        break;
366                  default:
367                          goto userr;
368                  }
# Line 423 | Line 430 | main(int argc, char *argv[])
430          return(0);
431   userr:
432          fprintf(stderr,
433 <        "Usage: %s [-g Nlog2][-t pctcull] [bsdf.sir ..] > bsdf.xml\n",
433 >        "Usage: %s [-g Nlog2][-t pctcull][-l maxlobes] [bsdf.sir ..] > bsdf.xml\n",
434                                  progname);
435          fprintf(stderr,
436          "   or: %s -t{3|4} [-g Nlog2][-t pctcull][{+|-}for[ward]][{+|-}b[ackward]][-e expr][-f file] bsdf_func > bsdf.xml\n",

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines