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.9 by schorsch, Sat Jun 7 00:54:58 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 + #include "copyright.h"
15 +
16   /*
17   * Since we've defined our vectors as float below to save space,
18   * watch out for changes in the definitions of VCOPY() and DOT()
19   * and don't pass these vectors to fvect routines.
20   */
21   typedef struct ambrec {
22 +        unsigned long  latick;  /* last accessed tick */
23          float  pos[3];          /* position in space */
24          float  dir[3];          /* normal direction */
25          int  lvl;               /* recursion level of parent ray */
# Line 23 | Line 31 | typedef struct ambrec {
31          struct ambrec  *next;   /* next in list */
32   }  AMBVAL;                      /* ambient value */
33  
34 < extern COLOR  ambval;           /* global ambient component */
35 < extern double  ambacc;          /* ambient accuracy */
36 < extern int  ambres;             /* ambient resolution */
37 < extern int  ambdiv;             /* number of divisions for calculation */
38 < extern int  ambssamp;           /* number of super-samples */
39 < extern int  ambounce;           /* number of ambient bounces */
40 < extern char  *amblist[];        /* ambient include/exclude list */
41 < extern int  ambincl;            /* include == 1, exclude == 0 */
34 > typedef struct ambtree {
35 >        AMBVAL  *alist;         /* ambient value list */
36 >        struct ambtree  *kid;   /* 8 child nodes */
37 > }  AMBTREE;                     /* ambient octree */
38 >
39 > typedef struct {
40 >        short  t, p;            /* theta, phi indices */
41 >        COLOR  v;               /* value sum */
42 >        float  r;               /* 1/distance sum */
43 >        float  k;               /* variance for this division */
44 >        int  n;                 /* number of subsamples */
45 > }  AMBSAMP;             /* ambient sample division */
46 >
47 > typedef struct {
48 >        FVECT  ux, uy, uz;      /* x, y and z axis directions */
49 >        short  nt, np;          /* number of theta and phi directions */
50 > }  AMBHEMI;             /* ambient sample hemisphere */
51 >
52   extern double  maxarad;         /* maximum ambient radius */
53   extern double  minarad;         /* minimum ambient radius */
54  
37 extern double  sumambient(), doambient(), makeambient();
38
55   #define  AVGREFL        0.5     /* assumed average reflectance */
56  
57   #define  AMBVALSIZ      75      /* number of bytes in portable AMBVAL struct */
58   #define  AMBMAGIC       557     /* magic number for ambient value files */
59   #define  AMBFMT         "Radiance_ambval"       /* format id string */
60 +
61 +                                        /* defined in ambcomp.c */
62 + extern int      divsample(AMBSAMP *dp, AMBHEMI *h, RAY *r);
63 + extern double   doambient(COLOR acol, RAY *r, double wt, FVECT pg, FVECT dg);
64 + extern void     inithemi(AMBHEMI *hp, RAY *r, double wt);
65 + extern void     comperrs(AMBSAMP *da, AMBHEMI *hp);
66 + extern void     posgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
67 + extern void     dirgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);
68 +                                        /* defined in ambient.c */
69 + extern void     setambres(int ar);
70 + extern void     setambacc(double newa);
71 + extern void     setambient(void);
72 + extern void     ambdone(void);
73 + extern void     ambnotify(OBJECT obj);
74 + extern void     ambient(COLOR acol, RAY *r, FVECT nrm);
75 + extern double   sumambient(COLOR acol, RAY *r, FVECT rn, int al,
76 +                                AMBTREE *at, FVECT c0, double s);
77 + extern double   makeambient(COLOR acol, RAY *r, FVECT rn, int al);
78 + extern void     extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv);
79 + extern int      ambsync(void);
80 +                                        /* defined in ambio.c */
81 + extern void     putambmagic(FILE *fp);
82 + extern int      hasambmagic(FILE *fp);
83 + extern int      writambval(AMBVAL *av, FILE *fp);
84 + extern int      ambvalOK(AMBVAL *av);
85 + extern int      readambval(AMBVAL *av, FILE *fp);
86 +                                        /* defined in lookamb.c */
87 + extern void     lookamb(FILE *fp);
88 + extern void     writamb(FILE *fp);
89 +
90 +
91 + #ifdef __cplusplus
92 + }
93 + #endif
94 + #endif /* _RAD_AMBIENT_H_ */
95 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines