--- ray/src/rt/ray.h 2020/02/26 17:58:06 2.42 +++ ray/src/rt/ray.h 2023/11/15 18:02:53 2.51 @@ -1,4 +1,4 @@ -/* RCSid $Id: ray.h,v 2.42 2020/02/26 17:58:06 greg Exp $ */ +/* RCSid $Id: ray.h,v 2.51 2023/11/15 18:02:53 greg Exp $ */ /* * ray.h - header file for routines using rays. */ @@ -16,10 +16,10 @@ extern "C" { #endif #ifndef RNUMBER -#define RNUMBER unsigned long /* ray counter (>= sizeof pointer) */ +#define RNUMBER size_t /* ray counter (>= sizeof pointer) */ #endif -#define MAXDIM 32 /* maximum number of dimensions */ +#define MAXDIM 32 /* maximum number of sampling dimensions */ /* ray type flags */ #define PRIMARY 01 /* original ray */ @@ -61,10 +61,10 @@ typedef struct ray { int rsrc; /* source we're aiming for */ float rweight; /* cumulative weight (for termination) */ float gecc; /* scattering eccentricity coefficient */ - COLOR rcoef; /* contribution coefficient w.r.t. parent */ - COLOR pcol; /* pattern color */ - COLOR mcol; /* mirrored color contribution */ - COLOR rcol; /* returned radiance value */ + SCOLOR rcoef; /* contribution coefficient w.r.t. parent */ + SCOLOR pcol; /* pattern color */ + SCOLOR mcol; /* mirrored color contribution */ + SCOLOR rcol; /* returned radiance value */ COLOR cext; /* medium extinction coefficient */ COLOR albedo; /* medium scattering albedo */ short rflips; /* surface orientation has been reversed */ @@ -75,12 +75,13 @@ typedef struct ray { #define rayvalue(r) (*(r)->revf)(r) -#define raydistance(r) (bright((r)->mcol) > 0.5*bright((r)->rcol) ? \ +#define raydistance(r) (pbright((r)->mcol) > 0.5*pbright((r)->rcol) ? \ (r)->rmt : (r)->rxt) #define rayreorient(r) if ((r)->rflips & 1) flipsurface(r); else -extern char VersionID[]; /* Radiance version ID string */ +extern char VersionID[]; /* Radiance version ID string */ +extern char RFeatureList[]; /* newline-separated feature list */ extern CUBE thescene; /* our scene */ extern OBJECT nsceneobjs; /* number of objects in our scene */ @@ -91,14 +92,12 @@ extern RNUMBER nrays; /* total rays traced so far */ extern OBJREC Lamb; /* a Lambertian surface */ extern OBJREC Aftplane; /* aft clipping object */ -extern void (*trace)(); /* global trace reporting callback */ +extern void (*trace)(RAY*); /* global trace reporting callback */ extern int dimlist[]; /* dimension list for distribution */ extern int ndims; /* number of dimensions so far */ extern int samplendx; /* index for this sample */ -extern int ray_savesiz; /* size of parameter save buffer */ - extern int do_irrad; /* compute irradiance? */ extern int rand_samp; /* pure Monte Carlo sampling? */ @@ -186,7 +185,7 @@ extern void headclean(void); extern void openheader(void); extern void dupheader(void); /* defined in persist.c */ -extern void persistfile(char *pfn); +extern void persistfile(char *pfn); extern void pfdetach(void); extern void pfclean(void); extern void pflock(int lf); @@ -218,9 +217,10 @@ extern int (*ray_fifo_out)(RAY *r); extern int ray_fifo_in(RAY *r); extern int ray_fifo_flush(void); /* defined in raytrace.c */ -extern int rayorigin(RAY *r, int rt, const RAY *ro, const COLOR rc); +extern int rayorigin(RAY *r, int rt, const RAY *ro, const SCOLOR rc); extern void rayclear(RAY *r); extern void raytrace(RAY *r); +extern int rayreject(OBJREC *o, RAY *r, double t, double rod); extern void rayhit(OBJECT *oset, RAY *r); extern void raycont(RAY *r); extern void raytrans(RAY *r); @@ -229,24 +229,25 @@ extern int rayshade(RAY *r, int mod); extern void rayparticipate(RAY *r); extern void raytexture(RAY *r, OBJECT mod); extern int raymixture(RAY *r, OBJECT fore, OBJECT back, double coef); -extern void raycontrib(RREAL rc[3], const RAY *r, int flags); +extern void raycontrib(SCOLOR rc, const RAY *r, int flags); extern double raydist(const RAY *r, int flags); extern double raynormal(FVECT norm, RAY *r); extern void newrayxf(RAY *r); extern void flipsurface(RAY *r); extern int localhit(RAY *r, CUBE *scene); /* defined in renderopts.c */ +extern int feature_status(int ac, char *av[]); extern int getrenderopt(int ac, char *av[]); extern void print_rdefaults(void); /* defined in srcdraw.c */ extern void drawsources(COLOR *pic[], float *zbf[], int x0, int xsiz, int y0, int ysiz); -extern void init_drawsources(int rad); +extern void init_drawsources(int rad); /* defined in rt/initotypes.c */ -extern void initotypes(void); +extern void initotypes(void); /* module main procedures */ extern void rtrace(char *fname, int nproc); -extern char *formstr(int f); +extern const char *formstr(int f); extern void rview(void); extern void rpict(int seq, char *pout, char *zout, char *prvr);