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

Comparing ray/src/common/loadbsdf.c (file contents):
Revision 3.4 by greg, Wed Apr 27 23:05:51 2011 UTC vs.
Revision 3.13 by greg, Sat Mar 27 17:50:18 2021 UTC

# Line 15 | Line 15 | char *
15   transSDError(SDError ec)
16   {
17          if (!SDerrorDetail[0])
18 <                return(strcpy(errmsg, SDerrorEnglish[ec]));
18 >                return(strcpy(errmsg, SDerrorList[ec]));
19  
20 <        sprintf(errmsg, "%s: %s", SDerrorEnglish[ec], SDerrorDetail);
20 >        sprintf(errmsg, "%s: %s", SDerrorList[ec], SDerrorDetail);
21          return(errmsg);
22   }
23  
# Line 50 | Line 50 | loadBSDF(char *fname)
50          pname = getpath(fname, getrlibpath(), R_OK);
51          if (pname == NULL) {
52                  sprintf(errmsg, "cannot find BSDF file \"%s\"", fname);
53 <                error(USER, errmsg);
53 >                error(SYSTEM, errmsg);
54          }
55          ec = SDloadFile(sd, pname);
56          if (ec)
# Line 58 | Line 58 | loadBSDF(char *fname)
58                                                  /* simple checks */
59          checkDF(sd->name, sd->rLambFront.cieY, sd->rf, "front reflection");
60          checkDF(sd->name, sd->rLambBack.cieY, sd->rb, "rear reflection");
61 <        checkDF(sd->name, sd->tLamb.cieY, sd->tf, "transmission");
62 < #if 1
61 >        checkDF(sd->name, sd->tLambFront.cieY, sd->tf, "front transmission");
62 >        checkDF(sd->name, sd->tLambBack.cieY, sd->tb, "back transmission");
63 > #ifdef DEBUG
64 > {
65 > float   rgb[3];
66   fprintf(stderr, "Loaded BSDF '%s' (file \"%s\")\n", sd->name, pname);
67 < fprintf(stderr, "Front diffuse reflectance: %.1f%%\n", sd->rLambFront.cieY*100.);
68 < fprintf(stderr, "Back diffuse reflectance: %.1f%%\n", sd->rLambBack.cieY*100.);
69 < fprintf(stderr, "Diffuse transmittance: %.1f%%\n", sd->tLamb.cieY*100.);
67 > ccy2rgb(&sd->rLambFront.spec, sd->rLambFront.cieY, rgb);
68 > fprintf(stderr, "Front diffuse RGB: %.4f %.4f %.4f\n", rgb[0], rgb[1], rgb[2]);
69 > ccy2rgb(&sd->rLambBack.spec, sd->rLambBack.cieY, rgb);
70 > fprintf(stderr, "Back diffuse RGB: %.4f %.4f %.4f\n", rgb[0], rgb[1], rgb[2]);
71 > ccy2rgb(&sd->tLambFront.spec, sd->tLamb.cieY, rgb);
72 > fprintf(stderr, "Front diffuse RGB transmittance: %.4f %.4f %.4f\n", rgb[0], rgb[1], rgb[2]);
73 > ccy2rgb(&sd->tLambBack.spec, sd->tLamb.cieY, rgb);
74 > fprintf(stderr, "Back diffuse RGB transmittance: %.4f %.4f %.4f\n", rgb[0], rgb[1], rgb[2]);
75   if (sd->rf)
76 < fprintf(stderr, "Maximum direct hemispherical front reflection: %.1f%%\n",
76 > fprintf(stderr, "Maximum direct hemispherical front reflection: %.3f%%\n",
77   sd->rf->maxHemi*100.);
78   if (sd->rb)
79 < fprintf(stderr, "Maximum direct hemispherical back reflection: %.1f%%\n",
79 > fprintf(stderr, "Maximum direct hemispherical back reflection: %.3f%%\n",
80   sd->rb->maxHemi*100.);
81   if (sd->tf)
82 < fprintf(stderr, "Maximum direct hemispherical transmission: %.1f%%\n",
82 > fprintf(stderr, "Maximum direct hemispherical front transmission: %.3f%%\n",
83   sd->tf->maxHemi*100.);
84 + if (sd->tb)
85 + fprintf(stderr, "Maximum direct hemispherical back transmission: %.3f%%\n",
86 + sd->tb->maxHemi*100.);
87 + }
88   #endif
89          SDretainSet = SDretainAll;              /* keep data in core */
90 + #ifdef  SMLMEM
91 +        SDmaxCache = 5L*1024*1024;
92 + #else
93 +        SDmaxCache = 250L*1024*1024;
94 + #endif
95          return(sd);
96   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines