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.29 by greg, Fri Jan 29 16:21:55 2016 UTC vs.
Revision 2.30 by greg, Sat Jan 30 01:31:57 2016 UTC

# Line 42 | Line 42 | unsigned long          bsdf_hist[HISTLEN];
42  
43                                  /* BSDF value for boundary regions */
44   double                  bsdf_min = 0;
45 < double                  bsdf_spec_peak = 0;
45 > double                  bsdf_spec_val = 0;
46   double                  bsdf_spec_rad = 0;
47  
48                                  /* processed incident DSF measurements */
# Line 443 | Line 443 | def_rbf_spec(const FVECT invec)
443  
444          if (input_orient > 0 ^ invec[2] > 0)    /* wrong side? */
445                  return(NULL);
446 <        if ((bsdf_spec_peak <= bsdf_min) | (bsdf_spec_rad <= 0))
446 >        if ((bsdf_spec_val <= bsdf_min) | (bsdf_spec_rad <= 0))
447                  return(NULL);                   /* nothing set */
448          rbf = (RBFNODE *)malloc(sizeof(RBFNODE));
449          if (rbf == NULL)
# Line 457 | Line 457 | def_rbf_spec(const FVECT invec)
457          rbf->ejl = NULL;
458          VCOPY(rbf->invec, invec);
459          rbf->nrbf = 1;
460 <        rbf->rbfa[0].peak = bsdf_spec_peak * output_orient*ovec[2];
460 >        rbf->rbfa[0].peak = bsdf_spec_val * COSF(ovec[2]);
461          rbf->rbfa[0].chroma = c_dfchroma;
462          rbf->rbfa[0].crad = ANG2R(bsdf_spec_rad);
463          rbf->rbfa[0].gx = pos[0];
# Line 583 | Line 583 | clear_bsdf_rep(void)
583          rbf_colorimetry = RBCunknown;
584          grid_res = GRIDRES;
585          bsdf_min = 0;
586 <        bsdf_spec_peak = 0;
586 >        bsdf_spec_val = 0;
587          bsdf_spec_rad = 0;
588   }
589  
# Line 604 | Line 604 | save_bsdf_rep(FILE *ofp)
604          fprintf(ofp, "COLORIMETRY=%s\n", RBCident[rbf_colorimetry]);
605          fprintf(ofp, "GRIDRES=%d\n", grid_res);
606          fprintf(ofp, "BSDFMIN=%g\n", bsdf_min);
607 <        if ((bsdf_spec_peak > bsdf_min) & (bsdf_spec_rad > 0))
608 <                fprintf(ofp, "BSDFSPEC= %f %f\n", bsdf_spec_peak, bsdf_spec_rad);
607 >        if ((bsdf_spec_val > bsdf_min) & (bsdf_spec_rad > 0))
608 >                fprintf(ofp, "BSDFSPEC= %f %f\n", bsdf_spec_val, bsdf_spec_rad);
609          fputformat(BSDFREP_FMT, ofp);
610          fputc('\n', ofp);
611          putint(BSDFREP_MAGIC, 2, ofp);
# Line 698 | Line 698 | headline(char *s, void *p)
698                  return(0);
699          }
700          if (!strncmp(s, "BSDFSPEC=", 9)) {
701 <                sscanf(s+9, "%lf %lf", &bsdf_spec_peak, &bsdf_spec_rad);
701 >                sscanf(s+9, "%lf %lf", &bsdf_spec_val, &bsdf_spec_rad);
702                  return(0);
703          }
704          if (formatval(fmt, s) && strcmp(fmt, BSDFREP_FMT))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines