ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/bsdf.h
(Generate patch)

Comparing ray/src/common/bsdf.h (file contents):
Revision 2.8 by greg, Mon Feb 21 22:50:37 2011 UTC vs.
Revision 2.12 by greg, Sun Apr 24 19:39:21 2011 UTC

# Line 33 | Line 33 | extern "C" {
33   #define SDnameLn        128             /* maximum BSDF name length */
34   #define SDmaxCh         3               /* maximum # spectral channels */
35  
36 < /* Component flags for SDsampBSDF() and SDhemiScatter() */
36 > /* Component flags for SDsampBSDF() and SDdirectHemi() */
37   #define SDsampR         0x1             /* include reflection */
38   #define SDsampT         0x2             /* include transmission */
39   #define SDsampS         0x3             /* include scattering (R+T) */
# Line 44 | Line 44 | extern "C" {
44   #define SDsampSpS       0x7             /* include non-diffuse scattering */
45   #define SDsampAll       0xF             /* include everything */
46  
47 < /* Projected solid angle query flags fos SDsizeBSDF() */
47 > /* Projected solid angle query flags for SDsizeBSDF() */
48   #define SDqueryVal      0x0             /* query single value */
49   #define SDqueryMin      0x1             /* query minimum proj. solid angle */
50   #define SDqueryMax      0x2             /* query maximum proj. solid angle */
# Line 81 | Line 81 | typedef struct SDComp_s        SDComponent;
81   typedef const struct {
82                                          /* return non-diffuse BSDF */
83          int             (*getBSDFs)(float coef[SDmaxCh], const FVECT outVec,
84 <                                    const FVECT inVec, const void *dist);
84 >                                    const FVECT inVec, SDComponent *sdc);
85                                          /* query non-diffuse PSA for vector */
86 <        SDError         (*queryProjSA)(double *psa, const FVECT vec,
87 <                                                int qflags, const void *dist);
86 >        SDError         (*queryProjSA)(double *psa, const FVECT v1,
87 >                                                const RREAL *v2, int qflags,
88 >                                                SDComponent *sdc);
89                                          /* get cumulative distribution */
90          const SDCDst    *(*getCDist)(const FVECT inVec, SDComponent *sdc);
91                                          /* sample cumulative distribution */
92 <        SDError         (*sampCDist)(FVECT outVec, double randX,
92 >        SDError         (*sampCDist)(FVECT ioVec, double randX,
93                                                  const SDCDst *cdp);
94                                          /* free a spectral BSDF component */
95          void            (*freeSC)(void *dist);
# Line 154 | Line 155 | extern SDSpectralDF    *SDnewSpectralDF(int nc);
155   /* Free a spectral distribution function */
156   extern void             SDfreeSpectralDF(SDSpectralDF *df);
157  
158 < /* Initialize an unused BSDF struct (clears to zeroes) */
159 < extern void             SDclearBSDF(SDData *sd);
158 > /* Initialize an unused BSDF struct and assign name (calls SDclipName) */
159 > extern void             SDclearBSDF(SDData *sd, const char *fname);
160  
161   /* Load a BSDF struct from the given file (keeps name unchanged) */
162   extern SDError          SDloadFile(SDData *sd, const char *fname);
# Line 170 | Line 171 | extern SDData          *SDgetCache(const char *bname);
171   extern void             SDfreeCumulativeCache(SDSpectralDF *df);
172  
173   /* Sample an individual BSDF component */
174 < extern SDError          SDsampComponent(SDValue *sv, FVECT outVec,
175 <                                        const FVECT inVec, double randX,
175 <                                        SDComponent *sdc);
174 > extern SDError          SDsampComponent(SDValue *sv, FVECT ioVec,
175 >                                        double randX, SDComponent *sdc);
176  
177   /* Convert 1-dimensional random variable to N-dimensional */
178   extern void             SDmultiSamp(double t[], int n, double randX);
# Line 195 | Line 195 | extern const SDData    *SDcacheFile(const char *fname);
195   /* Free a BSDF from our cache (clear all if NULL) */
196   extern void             SDfreeCache(const SDData *sd);
197  
198 < /* Query projected solid angle resolution for non-diffuse BSDF direction */
199 < extern SDError          SDsizeBSDF(double *projSA, const FVECT vec,
200 <                                        int qflags, const SDData *sd);
198 > /* Query projected solid angle resolution for non-diffuse BSDF direction(s) */
199 > extern SDError          SDsizeBSDF(double *projSA, const FVECT v1,
200 >                                        const RREAL *v2, int qflags,
201 >                                        const SDData *sd);
202  
203   /* Return BSDF for the given incident and scattered ray vectors */
204   extern SDError          SDevalBSDF(SDValue *sv, const FVECT outVec,
# Line 208 | Line 209 | extern double          SDdirectHemi(const FVECT inVec,
209                                          int sflags, const SDData *sd);
210  
211   /* Sample BSDF direction based on the given random variable */
212 < extern SDError          SDsampBSDF(SDValue *sv, FVECT outVec,
212 <                                        const FVECT inVec, double randX,
212 > extern SDError          SDsampBSDF(SDValue *sv, FVECT ioVec, double randX,
213                                          int sflags, const SDData *sd);
214  
215   /*****************************************************************

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines