| 35 |
|
struct ambtree *kid; /* 8 child nodes */ |
| 36 |
|
} AMBTREE; /* ambient octree */ |
| 37 |
|
|
| 38 |
– |
typedef struct { |
| 39 |
– |
COLOR v; /* division sum (partial) */ |
| 40 |
– |
float r; /* 1/distance sum */ |
| 41 |
– |
float k; /* variance for this division */ |
| 42 |
– |
int n; /* number of subsamples */ |
| 43 |
– |
unsigned short t, p; /* theta, phi indices */ |
| 44 |
– |
} AMBSAMP; /* ambient sample division */ |
| 45 |
– |
|
| 46 |
– |
typedef struct { |
| 47 |
– |
FVECT ux, uy, uz; /* x, y and z axis directions */ |
| 48 |
– |
COLOR acoef; /* division contribution coefficient */ |
| 49 |
– |
int ns; /* number of super-samples */ |
| 50 |
– |
int nt, np; /* number of theta and phi directions */ |
| 51 |
– |
} AMBHEMI; /* ambient sample hemisphere */ |
| 52 |
– |
|
| 38 |
|
extern double maxarad; /* maximum ambient radius */ |
| 39 |
|
extern double minarad; /* minimum ambient radius */ |
| 40 |
|
|
| 53 |
|
extern void multambient(COLOR aval, RAY *r, FVECT nrm); |
| 54 |
|
extern void ambdone(void); |
| 55 |
|
extern void ambnotify(OBJECT obj); |
| 71 |
– |
extern double sumambient(COLOR acol, RAY *r, FVECT rn, int al, |
| 72 |
– |
AMBTREE *at, FVECT c0, double s); |
| 73 |
– |
extern int makeambient(COLOR acol, RAY *r, FVECT rn, int al); |
| 74 |
– |
extern void extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv); |
| 56 |
|
extern int ambsync(void); |
| 57 |
|
/* defined in ambcomp.c */ |
| 58 |
|
extern int doambient(COLOR acol, RAY *r, double wt, |
| 59 |
|
FVECT uv[2], float rad[2], |
| 60 |
|
float gpos[2], float gdir[2]); |
| 80 |
– |
extern void inithemi(AMBHEMI *hp, COLOR ac, RAY *r, double wt); |
| 81 |
– |
extern int divsample(AMBSAMP *dp, AMBHEMI *h, RAY *r); |
| 82 |
– |
extern void comperrs(AMBSAMP *da, AMBHEMI *hp); |
| 83 |
– |
extern void posgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp); |
| 84 |
– |
extern void dirgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp); |
| 61 |
|
/* defined in ambio.c */ |
| 62 |
|
extern void putambmagic(FILE *fp); |
| 63 |
|
extern int hasambmagic(FILE *fp); |
| 64 |
|
extern int writambval(AMBVAL *av, FILE *fp); |
| 89 |
– |
extern int ambvalOK(AMBVAL *av); |
| 65 |
|
extern int readambval(AMBVAL *av, FILE *fp); |
| 66 |
+ |
extern int ambvalOK(AMBVAL *av); |
| 67 |
|
|
| 68 |
|
#else /* ! NEWAMB */ |
| 69 |
|
|
| 123 |
|
extern void multambient(COLOR aval, RAY *r, FVECT nrm); |
| 124 |
|
extern void ambdone(void); |
| 125 |
|
extern void ambnotify(OBJECT obj); |
| 150 |
– |
extern double sumambient(COLOR acol, RAY *r, FVECT rn, int al, |
| 151 |
– |
AMBTREE *at, FVECT c0, double s); |
| 152 |
– |
extern double makeambient(COLOR acol, RAY *r, FVECT rn, int al); |
| 153 |
– |
extern void extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv); |
| 126 |
|
extern int ambsync(void); |
| 127 |
|
/* defined in ambcomp.c */ |
| 128 |
|
extern double doambient(COLOR acol, RAY *r, double wt, |