--- ray/src/cv/checkBSDF.c 2022/01/26 17:30:07 2.6 +++ ray/src/cv/checkBSDF.c 2023/09/11 18:43:36 2.10 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: checkBSDF.c,v 2.6 2022/01/26 17:30:07 greg Exp $"; +static const char RCSid[] = "$Id: checkBSDF.c,v 2.10 2023/09/11 18:43:36 greg Exp $"; #endif /* * checkBSDF.c @@ -80,15 +80,22 @@ getBSDFtype(const SDData *bsdf, int *flags) void detailComponent(const char *nm, const SDValue *lamb, const SDSpectralDF *df) { - printf("%s\t%4.1f %4.1f %4.1f\t\t", nm, + double Lamb = 0; + + fputs(nm, stdout); + if (lamb->spec.flags) { + printf("\t%4.1f %4.1f %4.1f\t\t", 100.*lamb->cieY*lamb->spec.cx/lamb->spec.cy, 100.*lamb->cieY, 100.*lamb->cieY*(1.f - lamb->spec.cx - lamb->spec.cy)/lamb->spec.cy); + Lamb = lamb->cieY; + } else + fputs("\t 0 0 0\t\t", stdout); if (df) - printf("%5.1f%%\t\t%.2f deg\n", 100.*df->maxHemi, + printf("%5.1f%%\t\t%.2f deg\n", 100.*(Lamb+df->maxHemi), sqrt(df->minProjSA/M_PI)*(360./M_PI)); else - puts("0%\t\t180"); + printf("%5.1f%%\t\t180 deg\n", Lamb); } /* Add a value to stats */ @@ -222,7 +229,7 @@ checkReciprocity(const char *nm, const int side1, cons return; } nothing2do: - printf("%s\t0\t0\t0\n", nm); + printf("%s\t 0\t 0\t 0\n", nm); } /* Report on the given BSDF XML file */ @@ -250,7 +257,7 @@ checkXML(char *fname) printf("Type: %s\n", getBSDFtype(&myBSDF, &flags)); printf("Color: %d\n", (flags & F_IN_COLOR) != 0); printf("Has Geometry: %d\n", (myBSDF.mgf != NULL)); - puts("Component\tLambertian XYZ %\tMax. Dir\tMin. Angle"); + puts("Component\tLambertian XYZ (%)\tMax. Tot. Dir\tMin. Angle"); detailComponent("Interior Refl", &myBSDF.rLambFront, myBSDF.rf); detailComponent("Exterior Refl", &myBSDF.rLambBack, myBSDF.rb); detailComponent("Int->Ext Trans", &myBSDF.tLambFront, myBSDF.tf);