--- ray/src/util/glare.h 1991/04/10 15:59:04 1.13 +++ ray/src/util/glare.h 1991/11/12 17:19:16 2.1 @@ -11,9 +11,9 @@ #include "color.h" #include "setscan.h" -#define GLAREBR 10.0 /* glare source is this * avg. lum. */ +#define GLAREBR 7.0 /* glare source is this * avg. lum. */ -#define SAMPDENS 50 /* default samples per unit in image */ +#define SAMPDENS 75 /* default samples per unit in image */ #define TSAMPSTEP 10 /* sample step to compute threshold */ #define SEPS 1 /* sources this close ==> contig. */ @@ -23,6 +23,9 @@ #define TOOSMALL(s) ((s)->brt*(s)->dom < threshold*SAMIN) +#define SABIG .025 /* solid angle of splittable source */ +#define LCORR .8 /* linearity of splittable source */ + extern VIEW ourview; /* our view */ extern VIEW pictview; /* picture view */ extern VIEW leftview, rightview; /* leftmost and rightmost views */ @@ -37,11 +40,12 @@ extern ANGLE glarang[]; /* glare calculation angles * extern int nglarangs; extern double maxtheta; /* maximum glare angle (in radians) */ extern int hsize; /* horizontal size */ -extern int hlim; /* horizontal limit of central view */ #define nglardirs (2*nglarangs+1) #define vsize (sampdens-1) -#define h_theta(h) (-(double)(h)/(double)sampdens) +#define hscale(v) sqrt((double)(sampdens*sampdens - (v)*(v))) +#define hlim(v) (int)(maxtheta*hscale(v)) +#define h_theta(h,v) (-(h)/hscale(v)) extern struct illum { float theta; /* glare direction */ @@ -67,6 +71,7 @@ extern struct source { } *donelist; /* finished sources */ extern double getviewpix(); +extern double pixsize(); extern long npixinvw; /* number of samples in view */ extern long npixmiss; /* number of samples missing */