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.4 by greg, Mon Aug 10 08:46:38 1992 UTC vs.
Revision 2.10 by greg, Fri Jun 27 06:53:22 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   * Common definitions for interreflection routines.
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  
13   /*
14   * Since we've defined our vectors as float below to save space,
# Line 12 | Line 16
16   * and don't pass these vectors to fvect routines.
17   */
18   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 */
# Line 23 | Line 28 | typedef struct ambrec {
28          struct ambrec  *next;   /* next in list */
29   }  AMBVAL;                      /* ambient value */
30  
31 < extern COLOR  ambval;           /* global ambient component */
32 < extern double  ambacc;          /* ambient accuracy */
33 < extern int  ambres;             /* ambient resolution */
34 < extern int  ambdiv;             /* number of divisions for calculation */
35 < extern int  ambssamp;           /* number of super-samples */
36 < extern int  ambounce;           /* number of ambient bounces */
37 < extern char  *amblist[];        /* ambient include/exclude list */
38 < extern int  ambincl;            /* include == 1, exclude == 0 */
31 > typedef struct ambtree {
32 >        AMBVAL  *alist;         /* ambient value list */
33 >        struct ambtree  *kid;   /* 8 child nodes */
34 > }  AMBTREE;                     /* ambient octree */
35 >
36 > typedef struct {
37 >        short  t, p;            /* theta, phi indices */
38 >        COLOR  v;               /* value sum */
39 >        float  r;               /* 1/distance sum */
40 >        float  k;               /* variance for this division */
41 >        int  n;                 /* number of subsamples */
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 */
47 > }  AMBHEMI;             /* ambient sample hemisphere */
48 >
49   extern double  maxarad;         /* maximum ambient radius */
50   extern double  minarad;         /* minimum ambient radius */
51  
37 extern double  sumambient(), doambient(), makeambient();
38
52   #define  AVGREFL        0.5     /* assumed average reflectance */
53  
54   #define  AMBVALSIZ      75      /* number of bytes in portable AMBVAL struct */
55   #define  AMBMAGIC       557     /* magic number for ambient value files */
56   #define  AMBFMT         "Radiance_ambval"       /* format id string */
57 +
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);
65 +                                        /* defined in ambient.c */
66 + extern void     setambres(int ar);
67 + extern void     setambacc(double newa);
68 + extern void     setambient(void);
69 + extern void     ambdone(void);
70 + extern void     ambnotify(OBJECT obj);
71 + extern void     ambient(COLOR acol, RAY *r, FVECT nrm);
72 + extern double   sumambient(COLOR acol, RAY *r, FVECT rn, int al,
73 +                                AMBTREE *at, FVECT c0, double s);
74 + extern double   makeambient(COLOR acol, RAY *r, FVECT rn, int al);
75 + extern void     extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv);
76 + extern int      ambsync(void);
77 +                                        /* defined in ambio.c */
78 + extern void     putambmagic(FILE *fp);
79 + extern int      hasambmagic(FILE *fp);
80 + extern int      writambval(AMBVAL *av, FILE *fp);
81 + extern int      ambvalOK(AMBVAL *av);
82 + extern int      readambval(AMBVAL *av, FILE *fp);
83 +                                        /* defined in lookamb.c */
84 + extern void     lookamb(FILE *fp);
85 + extern void     writamb(FILE *fp);
86 +
87 +
88 + #ifdef __cplusplus
89 + }
90 + #endif
91 + #endif /* _RAD_AMBIENT_H_ */
92 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines