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 */ |
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 |
– |
COLOR acoef; /* coefficient for rayorigin() */ |
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 */ |
68 |
|
extern void ambnotify(OBJECT obj); |
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, COLOR ac, FVECT rn, int al); |
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, COLOR ac, double wt, |
75 |
> |
extern double doambient(COLOR acol, RAY *r, double wt, |
76 |
|
FVECT pg, FVECT dg); |
77 |
< |
extern int inithemi(AMBHEMI *hp, RAY *r, COLOR ac, double wt); |
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); |