--- ray/src/util/glare.h 1991/03/18 15:06:30 1.3 +++ ray/src/util/glare.h 1991/03/20 11:56:42 1.8 @@ -13,11 +13,16 @@ #define GLAREBR 10.0 /* glare source is this * avg. lum. */ -#define SAMPDENS 50 /* samples per unit in image */ +#define SAMPDENS 50 /* default samples per unit in image */ #define TSAMPSTEP 10 /* sample step to compute threshold */ #define SEPS 2 /* sources this close ==> contig. */ +#define SAMIN .005 /* minimum solid angle for source */ +#define MAXBUDDY (4.*sqrt(SAMIN/PI)) /* max separation for pairing */ + +#define TOOSMALL(s) ((s)->brt*(s)->dom < threshold*SAMIN) + extern VIEW ourview; /* our view */ extern VIEW pictview; /* picture view */ extern VIEW leftview, rightview; /* leftmost and rightmost views */ @@ -25,6 +30,9 @@ extern VIEW leftview, rightview; /* leftmost and right extern int verbose; /* verbose reporting */ extern char *progname; /* global argv[0] */ +extern double threshold; /* threshold value for glare sources */ + +extern int sampdens; /* sample density */ extern ANGLE glarang[]; /* glare calculation angles */ extern int nglarangs; extern double maxtheta; /* maximum glare angle (in radians) */ @@ -32,8 +40,8 @@ extern int hsize; /* horizontal size */ extern int hlim; /* horizontal limit of central view */ #define nglardirs (2*nglarangs+1) -#define vsize SAMPDENS -#define h_theta(h) ((double)(h)/-(double)SAMPDENS) +#define vsize (sampdens-1) +#define h_theta(h) (-(double)(h)/(double)sampdens) extern struct illum { float theta; /* glare direction */ @@ -52,8 +60,8 @@ struct srcspan { extern struct source { FVECT dir; /* source direction */ - float dom; /* solid angle of source */ - float brt; /* average source brightness */ + double dom; /* solid angle of source */ + double brt; /* average source brightness */ struct srcspan *first; /* first span for this source */ struct source *next; /* next source in list */ } *donelist; /* finished sources */