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

Comparing ray/src/gen/mkillum.h (file contents):
Revision 2.12 by greg, Mon Nov 5 23:40:26 2007 UTC vs.
Revision 2.13 by greg, Wed Dec 5 20:07:34 2007 UTC

# Line 27 | Line 27 | typedef enum {
27          UDypos=2,
28          UDzpos=3
29   } UpDir;
30 +                                /* BSDF coordinate calculation routines */
31 +                                /* vectors always point away from surface */
32 + typedef int     b_vecf(FVECT, int, char *);
33 + typedef int     b_ndxf(FVECT, char *);
34 + typedef double  b_radf(int, char *);
35  
36 < /* XXX need to add per-band data */
36 > /* Bidirectional Scattering Distribution Function */
37   struct BSDF_data {
33        double  om_scale;               /* maximum solid angle (sr/256) */
38          int     ninc;                   /* number of incoming directions */
35        int32   *inc_dir;               /* incoming direction codes */
36        BYTE    *inc_rad;               /* incoming radians to neighbor */
39          int     nout;                   /* number of outgoing directions */
40 <        int32   *out_dir;               /* outgoing direction codes */
41 <        BYTE    *out_rad;               /* outgoing radians to neighbor */
40 >        char    ib_priv[32];            /* input basis private data */
41 >        b_vecf  *ib_vec;                /* get input vector from index */
42 >        b_ndxf  *ib_ndx;                /* get input index from vector */
43 >        b_radf  *ib_rad;                /* get input radius for index */
44 >        char    ob_priv[32];            /* output basis private data */
45 >        b_vecf  *ob_vec;                /* get output vector from index */
46 >        b_ndxf  *ob_ndx;                /* get output index from vector */
47 >        b_radf  *ob_rad;                /* get output radius for index */
48          float   *bsdf;                  /* scattering distribution data */
49   };                              /* bidirectional scattering distrib. func. */
50  
# Line 56 | Line 64 | struct illum_args {
64          COLOR   col;                    /* computed average color */
65   };                              /* illum options */
66  
67 < #define getBSDF_incvec(v,b,i)   decodedir(v, (b)->inc_dir[i])
68 < #define getBSDF_outvec(v,b,o)   decodedir(v, (b)->out_dir[o])
69 < #define getBSDF_incrad(b,i)     ((b)->om_scale*((b)->inc_rad[i] + .5));
70 < #define getBSDF_outrad(b,o)     ((b)->om_scale*((b)->out_rad[o] + .5));
71 < #define BSDF_data(b,i,o)        (b)->bsdf[(o)*(b)->ninc + (i)]
67 > #define getBSDF_incvec(v,b,i)   (*(b)->ib_vec)(v,i,(b)->ib_priv)
68 > #define getBSDF_incndx(b,v)     (*(b)->ib_ndx)(v,(b)->ib_priv)
69 > #define getBSDF_incrad(b,i)     (*(b)->ib_rad)(i,(b)->ib_priv)
70 > #define getBSDF_outvec(v,b,o)   (*(b)->ob_vec)(v,o,(b)->ob_priv)
71 > #define getBSDF_outndx(b,v)     (*(b)->ob_ndx)(v,(b)->ob_priv)
72 > #define getBSDF_outrad(b,o)     (*(b)->ob_rad)(o,(b)->ob_priv)
73 > #define BSDF_visible(b,i,o)     (b)->bsdf[(o)*(b)->ninc + (i)]
74  
75   extern struct BSDF_data *load_BSDF(char *fname);
76   extern void free_BSDF(struct BSDF_data *b);
# Line 83 | Line 93 | extern void newdist(int siz);
93   extern int process_ray(RAY *r, int rv);
94   extern void raysamp(int ndx, FVECT org, FVECT dir);
95   extern void rayclean(void);
96 +
97 + extern void flatdir(FVECT  dv, double  alt, double  azi);
98  
99   extern int my_default(OBJREC *, struct illum_args *, char *);
100   extern int my_face(OBJREC *, struct illum_args *, char *);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines