--- ray/src/rt/ambient.h 2019/05/14 17:39:10 2.25 +++ ray/src/rt/ambient.h 2023/11/15 18:02:52 2.27 @@ -1,4 +1,4 @@ -/* RCSid $Id: ambient.h,v 2.25 2019/05/14 17:39:10 greg Exp $ */ +/* RCSid $Id: ambient.h,v 2.27 2023/11/15 18:02:52 greg Exp $ */ /* * Common definitions for interreflection routines. * @@ -16,17 +16,16 @@ extern "C" { */ typedef struct ambrec { struct ambrec *next; /* next in list */ - unsigned long latick; /* last accessed tick */ float pos[3]; /* position in space */ int32 ndir; /* encoded surface normal */ int32 udir; /* u-vector direction */ short lvl; /* recursion level of parent ray */ float weight; /* weight of parent ray */ float rad[2]; /* anisotropic radii (rad[0] <= rad[1]) */ - COLOR val; /* computed ambient value */ float gpos[2]; /* (u,v) gradient wrt. position */ float gdir[2]; /* (u,v) gradient wrt. direction */ uint32 corral; /* potential light leak direction flags */ + SCOLOR val; /* computed indirect irradiance (last!) */ } AMBVAL; /* ambient value */ typedef struct ambtree { @@ -41,23 +40,26 @@ extern double minarad; /* minimum ambient radius */ #define AVGREFL 0.5 /* assumed average reflectance */ #endif -#define AMBVALSIZ 67 /* number of bytes in portable AMBVAL struct */ -#define AMBMAGIC 559 /* magic number for ambient value files */ +#define AMBVALSIZ (64+AMB_CNDX[3]) /* number of bytes in portable AMBVAL */ +#define AMBMAGIC 561 /* magic number for ambient value file */ #define AMBFMT "Radiance_ambval" /* format id string */ /* defined in ambient.c */ extern void setambres(int ar); extern void setambacc(double newa); extern void setambient(void); -extern void multambient(COLOR aval, RAY *r, FVECT nrm); +extern void multambient(SCOLOR aval, RAY *r, FVECT nrm); extern void ambdone(void); extern void ambnotify(OBJECT obj); extern int ambsync(void); /* defined in ambcomp.c */ -extern int doambient(COLOR acol, RAY *r, double wt, +extern int doambient(SCOLOR acol, RAY *r, double wt, FVECT uv[2], float rad[2], float gpos[2], float gdir[2], uint32 *crlp); /* defined in ambio.c */ +extern int *AMB_CNDX; /* open ambient file RGBE indices */ +extern float *AMB_WLPART; /* open ambient file spectral range */ +extern int amb_headline(char *hl, void *p); extern void putambmagic(FILE *fp); extern int hasambmagic(FILE *fp); extern int writambval(AMBVAL *av, FILE *fp);