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.8 by greg, Tue Feb 25 02:47:22 2003 UTC vs.
Revision 2.14 by greg, Sat May 28 22:27:54 2005 UTC

# Line 4 | Line 4
4   *
5   * Include after ray.h
6   */
7 + #ifndef _RAD_AMBIENT_H_
8 + #define _RAD_AMBIENT_H_
9 + #ifdef __cplusplus
10 + extern "C" {
11 + #endif
12  
8 #include "copyright.h"
9
13   /*
14   * Since we've defined our vectors as float below to save space,
15   * watch out for changes in the definitions of VCOPY() and DOT()
# Line 16 | Line 19 | typedef struct ambrec {
19          unsigned long  latick;  /* last accessed tick */
20          float  pos[3];          /* position in space */
21          float  dir[3];          /* normal direction */
22 <        int  lvl;               /* recursion level of parent ray */
22 >        int    lvl;             /* recursion level of parent ray */
23          float  weight;          /* weight of parent ray */
24          float  rad;             /* validity radius */
25          COLOR  val;             /* computed ambient value */
# Line 39 | Line 42 | typedef struct {
42   }  AMBSAMP;             /* ambient sample division */
43  
44   typedef struct {
45 +        COLOR  acoef;           /* ambient contribution coefficient */
46 +        float  drc;             /* daughter ray coefficient */
47          FVECT  ux, uy, uz;      /* x, y and z axis directions */
48          short  nt, np;          /* number of theta and phi directions */
49 +        int    ns;              /* number of super-samples */
50   }  AMBHEMI;             /* ambient sample hemisphere */
51  
52   extern double  maxarad;         /* maximum ambient radius */
53   extern double  minarad;         /* minimum ambient radius */
54  
55 + #ifndef AVGREFL
56   #define  AVGREFL        0.5     /* assumed average reflectance */
57 + #endif
58  
59   #define  AMBVALSIZ      75      /* number of bytes in portable AMBVAL struct */
60   #define  AMBMAGIC       557     /* magic number for ambient value files */
61   #define  AMBFMT         "Radiance_ambval"       /* format id string */
62  
55 #ifdef NOPROTO
56
57 extern int      divsample();
58 extern double   doambient();
59 extern void     inithemi();
60 extern void     comperrs();
61 extern void     posgradient();
62 extern void     dirgradient();
63 extern void     setambres();
64 extern void     setambacc();
65 extern void     setambient();
66 extern void     ambdone();
67 extern void     ambnotify();
68 extern void     ambient();
69 extern double   sumambient();
70 extern double   makeambient();
71 extern void     extambient();
72 extern int      ambsync();
73 extern void     putambmagic();
74 extern int      hasambmagic();
75 extern int      writambval();
76 extern int      ambvalOK();
77 extern int      readambval();
78 extern void     lookamb();
79 extern void     writamb();
80
81 #else
82                                        /* defined in ambcomp.c */
83 extern int      divsample(AMBSAMP *dp, AMBHEMI *h, RAY *r);
84 extern double   doambient(COLOR acol, RAY *r, double wt, FVECT pg, FVECT dg);
85 extern void     inithemi(AMBHEMI *hp, RAY *r, double wt);
86 extern void     comperrs(AMBSAMP *da, AMBHEMI *hp);
87 extern void     posgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
88 extern void     dirgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
63                                          /* defined in ambient.c */
64   extern void     setambres(int ar);
65   extern void     setambacc(double newa);
66   extern void     setambient(void);
67 + extern void     multambient(COLOR aval, RAY *r, FVECT nrm);
68   extern void     ambdone(void);
69   extern void     ambnotify(OBJECT obj);
70 < extern void     ambient(COLOR acol, RAY *r, FVECT nrm);
96 < extern double   sumambient(COLOR acol, RAY *r, FVECT rn, int al,
70 > extern double   sumambient(COLOR acol, RAY *r, double rw, FVECT rn, int al,
71                                  AMBTREE *at, FVECT c0, double s);
72 < extern double   makeambient(COLOR acol, RAY *r, FVECT rn, int al);
72 > extern double   makeambient(COLOR acol, RAY *r, COLOR ac, FVECT rn, int al);
73   extern void     extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv);
74   extern int      ambsync(void);
75 +                                        /* defined in ambcomp.c */
76 + extern double   doambient(COLOR acol, RAY *r, COLOR ac, double wt,
77 +                                        FVECT pg, FVECT dg);
78 + extern void     inithemi(AMBHEMI *hp, RAY *r, COLOR ac, double wt);
79 + extern int      divsample(AMBSAMP *dp, AMBHEMI *h, RAY *r);
80 + extern void     comperrs(AMBSAMP *da, AMBHEMI *hp);
81 + extern void     posgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
82 + extern void     dirgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
83                                          /* defined in ambio.c */
84   extern void     putambmagic(FILE *fp);
85   extern int      hasambmagic(FILE *fp);
# Line 108 | Line 90 | extern int     readambval(AMBVAL *av, FILE *fp);
90   extern void     lookamb(FILE *fp);
91   extern void     writamb(FILE *fp);
92  
93 +
94 + #ifdef __cplusplus
95 + }
96   #endif
97 + #endif /* _RAD_AMBIENT_H_ */
98 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines