29 |
|
const SimpleStats SSinit = {FHUGE, -FHUGE, .0, 0}; |
30 |
|
|
31 |
|
/* relative difference formula */ |
32 |
< |
#define rdiff(a,b) ((a)>(b) ? ((a)-(b))/(a) : ((b)-(a))/(b)) |
32 |
> |
#define rdiff(a,b) ((a)>(b) ? ((a)-(b))/((a)+FTINY) : ((b)-(a))/((b)+FTINY)) |
33 |
|
|
34 |
|
/* Figure out BSDF type (and optionally determine if in color) */ |
35 |
|
const char * |
236 |
|
puts("====================================================="); |
237 |
|
printf("File: '%s'\n", fname); |
238 |
|
SDclearBSDF(&myBSDF, fname); |
239 |
< |
pth = getpath(fname, getrlibpath(), R_OK); |
239 |
> |
pth = getpath(fname, getrlibpath(), 0); |
240 |
|
if (!pth) { |
241 |
|
fprintf(stderr, "Cannot find file '%s'\n", fname); |
242 |
|
return 0; |
251 |
|
printf("Color: %d\n", (flags & F_IN_COLOR) != 0); |
252 |
|
printf("Has Geometry: %d\n", (myBSDF.mgf != NULL)); |
253 |
|
puts("Component\tLambertian XYZ %\tMax. Dir\tMin. Angle"); |
254 |
< |
detailComponent("Internal Refl", &myBSDF.rLambFront, myBSDF.rf); |
255 |
< |
detailComponent("External Refl", &myBSDF.rLambBack, myBSDF.rb); |
254 |
> |
detailComponent("Interior Refl", &myBSDF.rLambFront, myBSDF.rf); |
255 |
> |
detailComponent("Exterior Refl", &myBSDF.rLambBack, myBSDF.rb); |
256 |
|
detailComponent("Int->Ext Trans", &myBSDF.tLambFront, myBSDF.tf); |
257 |
|
detailComponent("Ext->Int Trans", &myBSDF.tLambBack, myBSDF.tb); |
258 |
|
puts("Component\tReciprocity Error (min avg max %)"); |
259 |
< |
checkReciprocity("Front Refl", 1, 1, &myBSDF, flags); |
260 |
< |
checkReciprocity("Back Refl", -1, -1, &myBSDF, flags); |
259 |
> |
checkReciprocity("Interior Refl", 1, 1, &myBSDF, flags); |
260 |
> |
checkReciprocity("Exterior Refl", -1, -1, &myBSDF, flags); |
261 |
|
checkReciprocity("Transmission", -1, 1, &myBSDF, flags); |
262 |
|
SDfreeBSDF(&myBSDF); |
263 |
|
return 1; |