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

Comparing ray/src/cv/bsdfrep.c (file contents):
Revision 2.25 by greg, Thu Aug 21 10:33:48 2014 UTC vs.
Revision 2.26 by greg, Thu Aug 21 13:44:05 2014 UTC

# Line 34 | Line 34 | unsigned long          bsdf_hist[HISTLEN];
34  
35                                  /* BSDF value for boundary regions */
36   double                  bsdf_min = 0;
37 < float                   bsdf_spec_peak = 0;
38 < int                     bsdf_spec_crad = 0;
37 > double                  bsdf_spec_peak = 0;
38 > double                  bsdf_spec_rad = 0;
39  
40                                  /* processed incident DSF measurements */
41   RBFNODE                 *dsf_list = NULL;
# Line 406 | Line 406 | def_rbf_spec(const FVECT invec)
406  
407          if (input_orient > 0 ^ invec[2] > 0)    /* wrong side? */
408                  return(NULL);
409 <        if ((bsdf_spec_peak <= bsdf_min) | (bsdf_spec_crad <= 0))
409 >        if ((bsdf_spec_peak <= bsdf_min) | (bsdf_spec_rad <= 0))
410                  return(NULL);                   /* nothing set */
411          rbf = (RBFNODE *)malloc(sizeof(RBFNODE));
412          if (rbf == NULL)
# Line 421 | Line 421 | def_rbf_spec(const FVECT invec)
421          VCOPY(rbf->invec, invec);
422          rbf->nrbf = 1;
423          rbf->rbfa[0].peak = bsdf_spec_peak * output_orient*ovec[2];
424 <        rbf->rbfa[0].crad = bsdf_spec_crad;
424 >        rbf->rbfa[0].crad = ANG2R(bsdf_spec_rad);
425          rbf->rbfa[0].gx = pos[0];
426          rbf->rbfa[0].gy = pos[1];
427          rbf->vtotal = rbf_volume(rbf->rbfa);
# Line 536 | Line 536 | clear_bsdf_rep(void)
536          grid_res = GRIDRES;
537          bsdf_min = 0;
538          bsdf_spec_peak = 0;
539 <        bsdf_spec_crad = 0;
539 >        bsdf_spec_rad = 0;
540   }
541  
542   /* Write our BSDF mesh interpolant out to the given binary stream */
# Line 555 | Line 555 | save_bsdf_rep(FILE *ofp)
555          fprintf(ofp, "IO_SIDES= %d %d\n", input_orient, output_orient);
556          fprintf(ofp, "GRIDRES=%d\n", grid_res);
557          fprintf(ofp, "BSDFMIN=%g\n", bsdf_min);
558 <        if ((bsdf_spec_peak > bsdf_min) & (bsdf_spec_crad > 0))
559 <                fprintf(ofp, "BSDFSPEC= %f %f\n", bsdf_spec_peak,
560 <                                        R2ANG(bsdf_spec_crad));
558 >        if ((bsdf_spec_peak > bsdf_min) & (bsdf_spec_rad > 0))
559 >                fprintf(ofp, "BSDFSPEC= %f %f\n", bsdf_spec_peak, bsdf_spec_rad);
560          fputformat(BSDFREP_FMT, ofp);
561          fputc('\n', ofp);
562                                          /* write each DSF */
# Line 636 | Line 635 | headline(char *s, void *p)
635                  return(0);
636          }
637          if (!strncmp(s, "BSDFSPEC=", 9)) {
638 <                float   bsdf_spec_rad = 0;
640 <                sscanf(s+9, "%f %f", &bsdf_spec_peak, &bsdf_spec_rad);
641 <                bsdf_spec_crad = ANG2R(bsdf_spec_rad);
638 >                sscanf(s+9, "%lf %lf", &bsdf_spec_peak, &bsdf_spec_rad);
639                  return(0);
640          }
641          if (formatval(fmt, s) && strcmp(fmt, BSDFREP_FMT))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines