--- ray/src/hd/rhd_sample.h 1999/01/10 10:27:45 3.5 +++ ray/src/hd/rhd_sample.h 1999/06/07 13:23:48 3.6 @@ -20,6 +20,7 @@ #define INVALID -1 #endif + typedef struct samp { float (*wp)[3]; /* world intersection point array */ int4 *wd; /* world direction array */ @@ -28,13 +29,15 @@ typedef struct samp { #endif BYTE (*chr)[3]; /* encoded chrominance array */ BYTE (*rgb)[3]; /* tone-mapped color array */ + int *info; /* Extra sample info */ + int *info1; /* Extra sample info */ int max_samp; /* maximum number of samples */ int max_base_pt; /* maximum number of aux points */ int next_base_pt; /* next auxilliary point to add */ int replace_samp; /* next sample to free */ int num_samp; /* current number of samples */ int tone_map; /* pointer to next value(s)t tonemap*/ - int free_samp; /* Available sample */ + int free_samp; /* free sample-not available yet */ char *base; /* base of allocated memory */ } SAMP; @@ -44,13 +47,15 @@ typedef struct samp { #define S_BRT(s) ((s)->brt) #define S_CHR(s) ((s)->chr) #define S_RGB(s) ((s)->rgb) +#define S_INFO(s) ((s)->info) +#define S_INFO1(s) ((s)->info1) #define S_MAX_SAMP(s) ((s)->max_samp) #define S_MAX_BASE_PT(s) ((s)->max_base_pt) #define S_NEXT_BASE_PT(s) ((s)->next_base_pt) #define S_REPLACE_SAMP(s) ((s)->replace_samp) #define S_NUM_SAMP(s) ((s)->num_samp) #define S_TONE_MAP(s) ((s)->tone_map) -#define S_FREE_SAMP(s) ((s)->free_samp) +#define S_FREE_SAMP(s) ((s)->free_samp) #define S_BASE(s) ((s)->base) #define S_MAX_POINTS(s) ((s)->max_base_pt) @@ -58,21 +63,28 @@ typedef struct samp { #define S_NTH_W_DIR(s,n) (S_W_DIR(s)[(n)]) #define S_NTH_RGB(s,n) (S_RGB(s)[(n)]) #define S_NTH_CHR(s,n) (S_CHR(s)[(n)]) -#ifndef HP_VERSION +#define S_NTH_INFO(s,n) (S_INFO(s)[(n)]) +#define S_NTH_INFO1(s,n) (S_INFO1(s)[(n)]) #define S_NTH_BRT(s,n) (S_BRT(s)[(n)]) -#endif + /* Sample Flag macros */ #define S_IS_FLAG(s) IS_FLAG(samp_flag,s) #define S_SET_FLAG(s) SET_FLAG(samp_flag,s) #define S_CLR_FLAG(s) CLR_FLAG(samp_flag,s) #define S_NTH_NEXT(s,n) S_NTH_W_DIR(s,n) -#define sUnalloc_samp(s,n) (S_NTH_NEXT(s,n) = S_FREE_SAMP(s),S_FREE_SAMP(s)=n) +#define sUnalloc_samp(s,n) (S_NTH_NEXT(s,n)=S_FREE_SAMP(s),S_FREE_SAMP(s)=n) #define sClear_base_points(s) (S_NEXT_BASE_PT(s) = S_MAX_SAMP(s)) #define sClear(s) sInit(s) -/* Max allowed angle of sample dir from current view */ -#define MAXANG 20 -#define MAXDIFF2 ( MAXANG*MAXANG * (PI*PI/180./180.)) +/* MAXDIFF2 Max allowed cos angle squared of sample dir from current view */ +/* In terms of cos: if angle is 30: MAXDIFF2 = cos(30)^2, if difference + is greater than this point not accepted on rebuild + */ +#define MAXDIFF2 0.75 +/* Max difference in direction for points at infinity: if over 45degrees + not accepted on rebuild cos(45) + */ +#define MAXDIR 0.70710678 #define MAXQUALITY 10000 /* Maximum quality for rendering rep */ extern SAMP rsL;