--- ray/src/common/bsdf_t.h 2011/04/24 19:39:21 3.6 +++ ray/src/common/bsdf_t.h 2018/01/05 21:00:24 3.13 @@ -1,4 +1,4 @@ -/* RCSid $Id: bsdf_t.h,v 3.6 2011/04/24 19:39:21 greg Exp $ */ +/* RCSid $Id: bsdf_t.h,v 3.13 2018/01/05 21:00:24 greg Exp $ */ /* * bsdf_t.h * @@ -29,23 +29,30 @@ typedef struct SDNode_s { } u; /* subtrees or values (extends struct) */ } SDNode; +#define SD_FREFL 1 /* component reflects off front side */ +#define SD_BREFL 2 /* component reflects off back side */ +#define SD_FXMIT 3 /* component transmits through front side */ +#define SD_BXMIT 4 /* component transmits through back side */ + /* Variable-resolution BSDF holder */ typedef struct { - int isxmit; /* transmitted component? */ - SDNode *st; /* BSDF tree */ + int sidef; /* which component */ + SDNode *stc[3]; /* BSDF (Y,u,v) trees */ } SDTre; /* Holder for cumulative distribution (sum of BSDF * projSA) */ -typedef struct { - SD_CDIST_BASE; /* base fields; must come first */ +typedef struct SDTreCDst_s { + /* base fields; must come first */ + SD_CDIST_BASE(SDTreCDst_s); double clim[2][2]; /* input coordinate limits */ double max_psa; /* maximum projected solid angle */ - int isxmit; /* transmitted component? */ + short sidef; /* which mode is in play */ + short isodist; /* isotropic distribution? */ int calen; /* cumulative array length */ struct { unsigned hndx; /* hilbert index */ unsigned cuml; /* cumulative value */ - } carr[1]; /* cumulative array (extends struct) */ + } carr[1]; /* cumulative array (extends struct) */ } SDTreCDst; #ifdef _EZXML_H @@ -54,7 +61,7 @@ extern SDError SDloadTre(SDData *sd, ezxml_t wtl); #endif /* Our matrix handling routines */ -extern SDFunc SDhandleTre; +extern const SDFunc SDhandleTre; #ifdef __cplusplus }