--- ray/src/rt/ambient.h 2005/04/19 01:15:06 2.12 +++ ray/src/rt/ambient.h 2010/10/05 18:05:23 2.17 @@ -1,4 +1,4 @@ -/* RCSid $Id: ambient.h,v 2.12 2005/04/19 01:15:06 greg Exp $ */ +/* RCSid $Id: ambient.h,v 2.17 2010/10/05 18:05:23 greg Exp $ */ /* * Common definitions for interreflection routines. * @@ -19,7 +19,7 @@ typedef struct ambrec { unsigned long latick; /* last accessed tick */ float pos[3]; /* position in space */ float dir[3]; /* normal direction */ - int lvl; /* recursion level of parent ray */ + int lvl; /* recursion level of parent ray */ float weight; /* weight of parent ray */ float rad; /* validity radius */ COLOR val; /* computed ambient value */ @@ -34,17 +34,18 @@ typedef struct ambtree { } AMBTREE; /* ambient octree */ typedef struct { - short t, p; /* theta, phi indices */ - COLOR v; /* value sum */ + COLOR v; /* division sum (partial) */ float r; /* 1/distance sum */ float k; /* variance for this division */ - int n; /* number of subsamples */ + int n; /* number of subsamples */ + unsigned short t, p; /* theta, phi indices */ } AMBSAMP; /* ambient sample division */ typedef struct { - COLOR acoef; /* coefficient for rayorigin() */ FVECT ux, uy, uz; /* x, y and z axis directions */ - short nt, np; /* number of theta and phi directions */ + COLOR acoef; /* division contribution coefficient */ + int ns; /* number of super-samples */ + int nt, np; /* number of theta and phi directions */ } AMBHEMI; /* ambient sample hemisphere */ extern double maxarad; /* maximum ambient radius */ @@ -67,13 +68,13 @@ extern void ambdone(void); extern void ambnotify(OBJECT obj); extern double sumambient(COLOR acol, RAY *r, FVECT rn, int al, AMBTREE *at, FVECT c0, double s); -extern double makeambient(COLOR acol, RAY *r, COLOR ac, FVECT rn, int al); +extern double makeambient(COLOR acol, RAY *r, FVECT rn, int al); extern void extambient(COLOR cr, AMBVAL *ap, FVECT pv, FVECT nv); extern int ambsync(void); /* defined in ambcomp.c */ -extern double doambient(COLOR acol, RAY *r, COLOR ac, double wt, +extern double doambient(COLOR acol, RAY *r, double wt, FVECT pg, FVECT dg); -extern int inithemi(AMBHEMI *hp, RAY *r, COLOR ac, double wt); +extern void inithemi(AMBHEMI *hp, COLOR ac, RAY *r, double wt); extern int divsample(AMBSAMP *dp, AMBHEMI *h, RAY *r); extern void comperrs(AMBSAMP *da, AMBHEMI *hp); extern void posgradient(FVECT gv, AMBSAMP *da, AMBHEMI *hp);