--- ray/src/common/bsdf.h 2016/02/03 01:54:51 2.23 +++ ray/src/common/bsdf.h 2021/03/27 17:50:18 2.28 @@ -1,4 +1,4 @@ -/* RCSid $Id: bsdf.h,v 2.23 2016/02/03 01:54:51 greg Exp $ */ +/* RCSid $Id: bsdf.h,v 2.28 2021/03/27 17:50:18 greg Exp $ */ /* * bsdf.h * @@ -25,15 +25,12 @@ #include "fvect.h" #include "ccolor.h" +#include "platform.h" #ifdef __cplusplus extern "C" { #endif -#ifdef _WIN32 -#define strcasecmp stricmp -#endif - #define SDnameLn 128 /* maximum BSDF name length */ #define SDmaxCh 3 /* maximum # spectral channels */ @@ -87,7 +84,7 @@ extern const SDCDst SDemptyCD; /* empty distribution * typedef struct SDComp_s SDComponent; /* Methods needed to handle BSDF components (nothing is optional) */ -typedef const struct { +typedef struct { /* return non-diffuse BSDF */ int (*getBSDFs)(float coef[SDmaxCh], const FVECT outVec, const FVECT inVec, SDComponent *sdc); @@ -107,7 +104,7 @@ typedef const struct { /* Structure to hold a spectral BSDF component (typedef SDComponent above) */ struct SDComp_s { C_COLOR cspec[SDmaxCh]; /* component spectral bases */ - SDFunc *func; /* methods for this component */ + const SDFunc *func; /* methods for this component */ void *dist; /* loaded distribution data */ SDCDst *cdList; /* cumulative distribution cache */ }; @@ -129,7 +126,8 @@ typedef struct { double dim[3]; /* width, height, thickness (meters) */ SDValue rLambFront; /* diffuse front reflectance */ SDValue rLambBack; /* diffuse rear reflectance */ - SDValue tLamb; /* diffuse transmission */ + SDValue tLambFront; /* diffuse front transmittance */ + SDValue tLambBack; /* diffuse back transmittance */ SDSpectralDF *rf, *rb; /* non-diffuse BRDF components */ SDSpectralDF *tf, *tb; /* non-diffuse BTDF components */ } SDData; @@ -148,6 +146,7 @@ extern struct SDCache_s { #define SDretainAll 2 /* also keep cumulative cache data */ extern int SDretainSet; /* =SDretainNone by default */ +extern unsigned long SDmaxCache; /* =0 (unlimited) by default */ /***************************************************************** * The following routines are less commonly used by applications.