1 |
greg |
1.1 |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
|
|
|
3 |
|
|
/* SCCSid "$SunId$ LBL" */ |
4 |
|
|
|
5 |
|
|
/* |
6 |
|
|
* Common definitions for interreflection routines. |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
/* |
10 |
|
|
* Since we've defined our vectors as float below to save space, |
11 |
|
|
* watch out for changes in the definitions of VCOPY() and DOT() |
12 |
|
|
* and don't pass these vectors to fvect routines. |
13 |
|
|
*/ |
14 |
|
|
typedef struct ambrec { |
15 |
greg |
2.5 |
unsigned long latick; /* last accessed tick */ |
16 |
greg |
1.1 |
float pos[3]; /* position in space */ |
17 |
|
|
float dir[3]; /* normal direction */ |
18 |
|
|
int lvl; /* recursion level of parent ray */ |
19 |
|
|
float weight; /* weight of parent ray */ |
20 |
|
|
float rad; /* validity radius */ |
21 |
|
|
COLOR val; /* computed ambient value */ |
22 |
|
|
float gpos[3]; /* gradient wrt. position */ |
23 |
|
|
float gdir[3]; /* gradient wrt. direction */ |
24 |
|
|
struct ambrec *next; /* next in list */ |
25 |
|
|
} AMBVAL; /* ambient value */ |
26 |
|
|
|
27 |
|
|
extern COLOR ambval; /* global ambient component */ |
28 |
greg |
2.6 |
extern int ambvwt; /* initial weight for ambient value */ |
29 |
greg |
1.1 |
extern double ambacc; /* ambient accuracy */ |
30 |
|
|
extern int ambres; /* ambient resolution */ |
31 |
|
|
extern int ambdiv; /* number of divisions for calculation */ |
32 |
|
|
extern int ambssamp; /* number of super-samples */ |
33 |
|
|
extern int ambounce; /* number of ambient bounces */ |
34 |
|
|
extern char *amblist[]; /* ambient include/exclude list */ |
35 |
|
|
extern int ambincl; /* include == 1, exclude == 0 */ |
36 |
|
|
extern double maxarad; /* maximum ambient radius */ |
37 |
|
|
extern double minarad; /* minimum ambient radius */ |
38 |
|
|
|
39 |
|
|
extern double sumambient(), doambient(), makeambient(); |
40 |
greg |
1.2 |
|
41 |
|
|
#define AVGREFL 0.5 /* assumed average reflectance */ |
42 |
greg |
2.2 |
|
43 |
|
|
#define AMBVALSIZ 75 /* number of bytes in portable AMBVAL struct */ |
44 |
greg |
2.4 |
#define AMBMAGIC 557 /* magic number for ambient value files */ |
45 |
greg |
2.3 |
#define AMBFMT "Radiance_ambval" /* format id string */ |