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

Comparing ray/src/rt/ambient.h (file contents):
Revision 2.10 by greg, Fri Jun 27 06:53:22 2003 UTC vs.
Revision 2.18 by greg, Thu Sep 22 02:15:56 2011 UTC

# Line 16 | Line 16 | extern "C" {
16   * and don't pass these vectors to fvect routines.
17   */
18   typedef struct ambrec {
19 +        struct ambrec  *next;   /* next in list */
20          unsigned long  latick;  /* last accessed tick */
21          float  pos[3];          /* position in space */
22          float  dir[3];          /* normal direction */
23 <        int  lvl;               /* recursion level of parent ray */
23 >        int    lvl;             /* recursion level of parent ray */
24          float  weight;          /* weight of parent ray */
25          float  rad;             /* validity radius */
26          COLOR  val;             /* computed ambient value */
27          float  gpos[3];         /* gradient wrt. position */
28          float  gdir[3];         /* gradient wrt. direction */
28        struct ambrec  *next;   /* next in list */
29   }  AMBVAL;                      /* ambient value */
30  
31   typedef struct ambtree {
# Line 34 | Line 34 | typedef struct ambtree {
34   }  AMBTREE;                     /* ambient octree */
35  
36   typedef struct {
37 <        short  t, p;            /* theta, phi indices */
38 <        COLOR  v;               /* value sum */
37 >        COLOR  v;               /* division sum (partial) */
38          float  r;               /* 1/distance sum */
39          float  k;               /* variance for this division */
40 <        int  n;                 /* number of subsamples */
40 >        int    n;               /* number of subsamples */
41 >        unsigned short  t, p;   /* theta, phi indices */
42   }  AMBSAMP;             /* ambient sample division */
43  
44   typedef struct {
45          FVECT  ux, uy, uz;      /* x, y and z axis directions */
46 <        short  nt, np;          /* number of theta and phi directions */
46 >        COLOR  acoef;           /* division contribution coefficient */
47 >        int    ns;              /* number of super-samples */
48 >        int    nt, np;          /* number of theta and phi directions */
49   }  AMBHEMI;             /* ambient sample hemisphere */
50  
51   extern double  maxarad;         /* maximum ambient radius */
52   extern double  minarad;         /* minimum ambient radius */
53  
54 + #ifndef AVGREFL
55   #define  AVGREFL        0.5     /* assumed average reflectance */
56 + #endif
57  
58   #define  AMBVALSIZ      75      /* number of bytes in portable AMBVAL struct */
59   #define  AMBMAGIC       557     /* magic number for ambient value files */
60   #define  AMBFMT         "Radiance_ambval"       /* format id string */
61  
58                                        /* defined in ambcomp.c */
59 extern int      divsample(AMBSAMP *dp, AMBHEMI *h, RAY *r);
60 extern double   doambient(COLOR acol, RAY *r, double wt, FVECT pg, FVECT dg);
61 extern void     inithemi(AMBHEMI *hp, RAY *r, double wt);
62 extern void     comperrs(AMBSAMP *da, AMBHEMI *hp);
63 extern void     posgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
64 extern void     dirgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
62                                          /* defined in ambient.c */
63   extern void     setambres(int ar);
64   extern void     setambacc(double newa);
65   extern void     setambient(void);
66 + extern void     multambient(COLOR aval, RAY *r, FVECT nrm);
67   extern void     ambdone(void);
68   extern void     ambnotify(OBJECT obj);
71 extern void     ambient(COLOR acol, RAY *r, FVECT nrm);
69   extern double   sumambient(COLOR acol, RAY *r, FVECT rn, int al,
70                                  AMBTREE *at, FVECT c0, double s);
71   extern double   makeambient(COLOR acol, RAY *r, FVECT rn, int al);
72   extern void     extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv);
73   extern int      ambsync(void);
74 +                                        /* defined in ambcomp.c */
75 + extern double   doambient(COLOR acol, RAY *r, double wt,
76 +                                        FVECT pg, FVECT dg);
77 + extern void     inithemi(AMBHEMI *hp, COLOR ac, RAY *r, double wt);
78 + extern int      divsample(AMBSAMP *dp, AMBHEMI *h, RAY *r);
79 + extern void     comperrs(AMBSAMP *da, AMBHEMI *hp);
80 + extern void     posgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
81 + extern void     dirgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
82                                          /* defined in ambio.c */
83   extern void     putambmagic(FILE *fp);
84   extern int      hasambmagic(FILE *fp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines