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

Comparing ray/src/cv/bsdf2klems.c (file contents):
Revision 2.3 by greg, Tue Apr 23 23:19:09 2013 UTC vs.
Revision 2.4 by greg, Thu Apr 25 03:12:08 2013 UTC

# Line 17 | Line 17 | static const char RCSid[] = "$Id$";
17   #include "calcomp.h"
18   #include "bsdfrep.h"
19   #include "bsdf_m.h"
20 +                                /* assumed maximum # Klems patches */
21 + #define MAXPATCHES      145
22                                  /* global argv[0] */
23   char                    *progname;
24                                  /* selected basis function name */
# Line 263 | Line 265 | eval_function(char *funame)
265          double          sum;
266          int             i, j, n;
267  
268 +        initurand(npsamps);
269          data_prologue();                        /* begin output */
270          for (j = 0; j < abp->nangles; j++) {    /* run through directions */
271              for (i = 0; i < abp->nangles; i++) {
# Line 274 | Line 277 | eval_function(char *funame)
277                          bo_getvec(iovec+3, j+(n+frandom())/npsamps, abp);
278  
279                      if (input_orient > 0)
280 <                        fi_getvec(iovec, i+(n+frandom())/npsamps, abp);
280 >                        fi_getvec(iovec, i+urand(n), abp);
281                      else
282 <                        bi_getvec(iovec, i+(n+frandom())/npsamps, abp);
282 >                        bi_getvec(iovec, i+urand(n), abp);
283  
284                      sum += funvalue(funame, 6, iovec);
285                  }
# Line 291 | Line 294 | eval_function(char *funame)
294   static void
295   eval_rbf(void)
296   {
294 #define MAXPATCHES      145
297          ANGLE_BASIS     *abp = get_basis(kbasis);
298          float           bsdfarr[MAXPATCHES*MAXPATCHES];
299          FVECT           vin, vout;
# Line 332 | Line 334 | eval_rbf(void)
334              putchar('\n');
335          }
336          data_epilogue();                        /* finish output */
335 #undef MAXPATCHES
337   }
338  
339   /* Read in BSDF and interpolate as Klems matrix representation */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines