--- ray/src/common/bsdf.h 2011/02/18 00:40:25 2.4 +++ ray/src/common/bsdf.h 2011/02/23 21:58:31 2.9 @@ -1,4 +1,4 @@ -/* RCSid $Id: bsdf.h,v 2.4 2011/02/18 00:40:25 greg Exp $ */ +/* RCSid $Id: bsdf.h,v 2.9 2011/02/23 21:58:31 greg Exp $ */ /* * bsdf.h * @@ -9,6 +9,11 @@ * in the surface plane pointed to the right as seen from the front. * This means the Y-axis is "up" and the Z-axis is the surface normal. * + * Note that we reverse the identification of "front" and "back" from + * the conventions used in WINDOW 6. "Front" in our library points + * in the +Z direction, towards the interior of the space rather + * than the exterior. + * * BSDF vectors always oriented away from surface, even when "incident." * * Created by Greg Ward on 1/10/11. @@ -28,7 +33,7 @@ extern "C" { #define SDnameLn 128 /* maximum BSDF name length */ #define SDmaxCh 3 /* maximum # spectral channels */ -/* Component flags for SDsampBSDF() and SDhemiScatter() */ +/* Component flags for SDsampBSDF() and SDdirectHemi() */ #define SDsampR 0x1 /* include reflection */ #define SDsampT 0x2 /* include transmission */ #define SDsampS 0x3 /* include scattering (R+T) */ @@ -39,11 +44,10 @@ extern "C" { #define SDsampSpS 0x7 /* include non-diffuse scattering */ #define SDsampAll 0xF /* include everything */ -/* Projected solid angle query flags fos SDsizeBSDF() */ -#define SDqueryInc 0x1 /* query incoming vector */ -#define SDqueryOut 0x2 /* query outgoing vector */ -#define SDqueryMin 0x4 /* query minimum proj. solid angle */ -#define SDqueryMax 0x8 /* query maximum proj. solid angle */ +/* Projected solid angle query flags for SDsizeBSDF() */ +#define SDqueryVal 0x0 /* query single value */ +#define SDqueryMin 0x1 /* query minimum proj. solid angle */ +#define SDqueryMax 0x2 /* query maximum proj. solid angle */ /* Error codes: normal return, out of memory, file i/o, file format, bad argument, bad data, unsupported feature, internal error, unknown error */ @@ -136,7 +140,7 @@ extern int SDretainSet; /* set to SDretainNone by def * The following routines are less commonly used by applications. */ -#define SDisLoaded(sd) ((sd)->rLambFront.spec.clock != 0) +#define SDisLoaded(sd) ((sd)->rLambFront.spec.flags != 0) /* Report an error to the indicated stream (in English) */ extern SDError SDreportEnglish(SDError ec, FILE *fp); @@ -223,6 +227,12 @@ extern SDError SDinvXform(RREAL iMtx[3][3], RREAL vMt /* Transform and normalize direction (column) vector */ extern SDError SDmapDir(FVECT resVec, RREAL vMtx[3][3], const FVECT inpVec); + +/* System-specific BSDF loading routine (not part of our library) */ +extern SDData *loadBSDF(char *name); + +/* System-specific BSDF error translator (not part of our library) */ +extern char *transSDError(SDError ec); /*################################################################*/ /*######### DEPRECATED DEFINITIONS AWAITING PERMANENT REMOVAL #######*/