75 |
|
bsdf_min = myBSDF.rLambFront.cieY/M_PI; |
76 |
|
if (myBSDF.rb != NULL && myBSDF.rLambBack.cieY < bsdf_min*M_PI) |
77 |
|
bsdf_min = myBSDF.rLambBack.cieY/M_PI; |
78 |
< |
if ((myBSDF.tf != NULL) | (myBSDF.tb != NULL) && |
79 |
< |
myBSDF.tLamb.cieY < bsdf_min*M_PI) |
80 |
< |
bsdf_min = myBSDF.tLamb.cieY/M_PI; |
78 |
> |
if (myBSDF.tf != NULL && myBSDF.tLambFront.cieY < bsdf_min*M_PI) |
79 |
> |
bsdf_min = myBSDF.tLambFront.cieY/M_PI; |
80 |
> |
if (myBSDF.tb != NULL && myBSDF.tLambBack.cieY < bsdf_min*M_PI) |
81 |
> |
bsdf_min = myBSDF.tLambBack.cieY/M_PI; |
82 |
|
if (doTrans && (myBSDF.tf == NULL) & (myBSDF.tb == NULL)) { |
83 |
|
fprintf(stderr, "%s: no transmitted component in '%s'\n", |
84 |
|
progname, argv[1]); |
96 |
|
fclose(fp); |
97 |
|
} |
98 |
|
#ifdef DEBUG |
99 |
< |
fprintf(stderr, "Minimum BSDF set to %.4f\n", bsdf_min); |
99 |
> |
fprintf(stderr, "Minimum BSDF set to %.4g\n", bsdf_min); |
100 |
|
#endif |
101 |
< |
min_log = log(bsdf_min*.5 + 1e-5); |
101 |
> |
min_log = log(bsdf_min*.5 + 1e-6); |
102 |
|
/* output BSDF rep. */ |
103 |
|
for (n = 0; (n < 6) & (2*n+3 < argc); n++) { |
104 |
|
double theta = (M_PI/180.)*atof(argv[2*n+2]); |
124 |
|
rbf = advect_rbf(idir, 15000); |
125 |
|
#ifdef DEBUG |
126 |
|
if (inpXML) |
127 |
< |
fprintf(stderr, "Hemispherical %s: %.3f\n", |
127 |
> |
fprintf(stderr, "Hemispherical %s: %.4f\n", |
128 |
|
(output_orient > 0 ^ input_orient > 0 ? |
129 |
|
"transmission" : "reflection"), |
130 |
|
SDdirectHemi(idir, SDsampSp|SDsampDf | |
133 |
|
else if (rbf == NULL) |
134 |
|
fputs("Empty RBF\n", stderr); |
135 |
|
else |
136 |
< |
fprintf(stderr, "Hemispherical %s: %.3f\n", |
136 |
> |
fprintf(stderr, "Hemispherical %s: %.4f\n", |
137 |
|
(output_orient > 0 ^ input_orient > 0 ? |
138 |
|
"transmission" : "reflection"), |
139 |
|
rbf->vtotal); |
173 |
|
bsdf = sval.cieY; |
174 |
|
} else |
175 |
|
bsdf = eval_rbfrep(rbf, odir); |
176 |
< |
bsdf = log(bsdf + 1e-5) - min_log; |
176 |
> |
bsdf = log(bsdf + 1e-6) - min_log; |
177 |
|
fprintf(fp, "%.8e %.8e %.8e\n", |
178 |
|
odir[0]*bsdf, odir[1]*bsdf, odir[2]*bsdf); |
179 |
|
} |