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

Comparing ray/src/common/bsdf.c (file contents):
Revision 2.7 by greg, Tue Sep 7 23:10:50 2010 UTC vs.
Revision 2.8 by greg, Sun Sep 26 15:43:26 2010 UTC

# Line 249 | Line 249 | to_meters(             /* return factor to convert given unit to
249          if (!strcasecmp(unit, "Foot")) return(.3048);
250          if (!strcasecmp(unit, "Inch")) return(.0254);
251          if (!strcasecmp(unit, "Centimeter")) return(.01);
252 +        if (!strcasecmp(unit, "Millimeter")) return(.001);
253          sprintf(errmsg, "unknown dimensional unit '%s'", unit);
254          error(USER, errmsg);
255   }
# Line 445 | Line 446 | check_bsdf_data(       /* check that BSDF data is sane */
446                                  BSDF_value(dp,i,o) = .0f;
447                          }
448                  }
449 <                if (hemi_total > 1.02) {
449 >                if (hemi_total > 1.01) {
450                          sprintf(errmsg,
451                          "incoming BSDF direction %d passes %.1f%% of light",
452                                          i, 100.*hemi_total);
# Line 462 | Line 463 | check_bsdf_data(       /* check that BSDF data is sane */
463                  for (i = dp->ninc; i--; )
464                          hemi_total += BSDF_value(dp,i,o) * omega_iarr[i];
465  
466 <                if (hemi_total > 1.02) {
466 >                if (hemi_total > 1.01) {
467                          sprintf(errmsg,
468                          "outgoing BSDF direction %d collects %.1f%% of light",
469                                          o, 100.*hemi_total);
# Line 471 | Line 472 | check_bsdf_data(       /* check that BSDF data is sane */
472                  full_total += hemi_total*omega_oarr[o];
473          }
474          full_total /= PI;
475 <        if (full_total > 1.02) {
476 <                sprintf(errmsg, "BSDF transfers %.1f%% of light",
475 >        if (full_total > 1.00001) {
476 >                sprintf(errmsg, "BSDF transfers %.4f%% of light",
477                                  100.*full_total);
478                  error(WARNING, errmsg);
479          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines