84 |
|
typedef struct SDComp_s SDComponent; |
85 |
|
|
86 |
|
/* Methods needed to handle BSDF components (nothing is optional) */ |
87 |
< |
typedef const struct { |
87 |
> |
typedef struct { |
88 |
|
/* return non-diffuse BSDF */ |
89 |
< |
int (*getBSDFs)(float coef[SDmaxCh], const FVECT outVec, |
90 |
< |
const FVECT inVec, SDComponent *sdc); |
89 |
> |
int (*getBSDFs)(float coef[SDmaxCh], const FVECT inVec, |
90 |
> |
const FVECT outVec, SDComponent *sdc); |
91 |
|
/* query non-diffuse PSA for vector */ |
92 |
|
SDError (*queryProjSA)(double *psa, const FVECT v1, |
93 |
|
const RREAL *v2, int qflags, |
104 |
|
/* Structure to hold a spectral BSDF component (typedef SDComponent above) */ |
105 |
|
struct SDComp_s { |
106 |
|
C_COLOR cspec[SDmaxCh]; /* component spectral bases */ |
107 |
< |
SDFunc *func; /* methods for this component */ |
107 |
> |
const SDFunc *func; /* methods for this component */ |
108 |
|
void *dist; /* loaded distribution data */ |
109 |
|
SDCDst *cdList; /* cumulative distribution cache */ |
110 |
|
}; |
126 |
|
double dim[3]; /* width, height, thickness (meters) */ |
127 |
|
SDValue rLambFront; /* diffuse front reflectance */ |
128 |
|
SDValue rLambBack; /* diffuse rear reflectance */ |
129 |
< |
SDValue tLamb; /* diffuse transmission */ |
129 |
> |
SDValue tLambFront; /* diffuse front transmittance */ |
130 |
> |
SDValue tLambBack; /* diffuse back transmittance */ |
131 |
|
SDSpectralDF *rf, *rb; /* non-diffuse BRDF components */ |
132 |
|
SDSpectralDF *tf, *tb; /* non-diffuse BTDF components */ |
133 |
|
} SDData; |
146 |
|
#define SDretainAll 2 /* also keep cumulative cache data */ |
147 |
|
|
148 |
|
extern int SDretainSet; /* =SDretainNone by default */ |
149 |
+ |
extern unsigned long SDmaxCache; /* =0 (unlimited) by default */ |
150 |
|
|
151 |
|
/***************************************************************** |
152 |
|
* The following routines are less commonly used by applications. |
215 |
|
const SDData *sd); |
216 |
|
|
217 |
|
/* Return BSDF for the given incident and scattered ray vectors */ |
218 |
< |
extern SDError SDevalBSDF(SDValue *sv, const FVECT outVec, |
219 |
< |
const FVECT inVec, const SDData *sd); |
218 |
> |
extern SDError SDevalBSDF(SDValue *sv, const FVECT inVec, |
219 |
> |
const FVECT outVec, const SDData *sd); |
220 |
|
|
221 |
|
/* Compute directional hemispherical scattering at given incident angle */ |
222 |
|
extern double SDdirectHemi(const FVECT inVec, |