ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/ray.h
(Generate patch)

Comparing ray/src/rt/ray.h (file contents):
Revision 2.44 by greg, Tue Jun 16 17:58:11 2020 UTC vs.
Revision 2.59 by greg, Fri Jun 20 03:43:17 2025 UTC

# Line 16 | Line 16 | extern "C" {
16   #endif
17  
18   #ifndef RNUMBER
19 < #define RNUMBER         unsigned long   /* ray counter (>= sizeof pointer) */
19 > #define RNUMBER         size_t          /* ray counter (>= sizeof pointer) */
20   #endif
21  
22 < #define  MAXDIM         32      /* maximum number of dimensions */
22 > #define  MAXDIM         32      /* maximum number of sampling dimensions */
23  
24                                  /* ray type flags */
25   #define  PRIMARY        01              /* original ray */
26 < #define  SHADOW         02              /* ray to light source */
26 > #define  RSHADOW        02              /* reflected ray to light source */
27   #define  REFLECTED      04              /* reflected ray */
28   #define  REFRACTED      010             /* refracted (bent) ray */
29   #define  TRANS          020             /* transmitted/transferred ray */
30 < #define  AMBIENT        040             /* ray scattered for interreflection */
31 < #define  SPECULAR       0100            /* ray scattered for specular */
30 > #define  RAMBIENT       040             /* reflected diffuse interreflection */
31 > #define  RSPECULAR      0100            /* reflected specular */
32 > #define  TSHADOW        0200            /* transmitted shadow */
33 > #define  TAMBIENT       0400            /* transmitted ambient */
34 > #define  TSPECULAR      01000           /* transmitted specular */
35 > #define  SHADOW         (RSHADOW|TSHADOW)
36 > #define  AMBIENT        (RAMBIENT|TAMBIENT)
37 > #define  SPECULAR       (RSPECULAR|TSPECULAR)
38  
39                                  /* reflected ray types */
40 < #define  RAYREFL        (SHADOW|REFLECTED|AMBIENT|SPECULAR)
40 > #define  RAYREFL        (RSHADOW|REFLECTED|RAMBIENT|RSPECULAR)
41  
42   /* Arrange so double's come first for optimal alignment */
43   /* Pointers and long's come second for 64-bit mode */
# Line 58 | Line 64 | typedef struct ray {
64          int     *slights;       /* list of lights to test for scattering */
65          RNUMBER rno;            /* unique ray number */
66          OBJECT  robj;           /* intersected object number */
67 <        int     rsrc;           /* source we're aiming for */
67 >        int     rsrc;           /* source we're aiming for (or ones to skip) */
68          float   rweight;        /* cumulative weight (for termination) */
69          float   gecc;           /* scattering eccentricity coefficient */
70 <        COLOR   rcoef;          /* contribution coefficient w.r.t. parent */
71 <        COLOR   pcol;           /* pattern color */
72 <        COLOR   mcol;           /* mirrored color contribution */
73 <        COLOR   rcol;           /* returned radiance value */
70 >        SCOLOR  rcoef;          /* contribution coefficient w.r.t. parent */
71 >        SCOLOR  pcol;           /* pattern color */
72 >        SCOLOR  mcol;           /* mirrored color contribution */
73 >        SCOLOR  rcol;           /* returned radiance value */
74          COLOR   cext;           /* medium extinction coefficient */
75          COLOR   albedo;         /* medium scattering albedo */
76          short   rflips;         /* surface orientation has been reversed */
# Line 75 | Line 81 | typedef struct ray {
81  
82   #define  rayvalue(r)    (*(r)->revf)(r)
83  
84 < #define  raydistance(r) (bright((r)->mcol) > 0.5*bright((r)->rcol) ? \
84 > #define  thrudir(r,v)   ((r)->rod > 0 ^ DOT((r)->ron,v) > 0)
85 >
86 > #define  raydistance(r) (pbright((r)->mcol) > 0.5*pbright((r)->rcol) ? \
87                                  (r)->rmt : (r)->rxt)
88  
89   #define  rayreorient(r) if ((r)->rflips & 1) flipsurface(r); else
90  
91 < extern char  VersionID[];       /* Radiance version ID string */
91 > extern char     VersionID[];    /* Radiance version ID string */
92 > extern char     RFeatureList[]; /* newline-separated feature list */
93  
94   extern CUBE     thescene;       /* our scene */
95   extern OBJECT   nsceneobjs;     /* number of objects in our scene */
# Line 91 | Line 100 | extern RNUMBER nrays;          /* total rays traced so far */
100   extern OBJREC  Lamb;            /* a Lambertian surface */
101   extern OBJREC  Aftplane;        /* aft clipping object */
102  
103 < extern void     (*trace)();     /* global trace reporting callback */
103 > extern void     (*trace)(RAY*); /* global trace reporting callback */
104  
105   extern int      dimlist[];      /* dimension list for distribution */
106   extern int      ndims;          /* number of dimensions so far */
107 < extern int      samplendx;      /* index for this sample */
107 > extern unsigned long
108 >                samplendx;      /* index for this sample */
109  
100 extern int      ray_savesiz;    /* size of parameter save buffer */
101
110   extern int      do_irrad;       /* compute irradiance? */
111  
112   extern int      rand_samp;      /* pure Monte Carlo sampling? */
# Line 186 | Line 194 | extern void    headclean(void);
194   extern void     openheader(void);
195   extern void     dupheader(void);
196                                          /* defined in persist.c */
197 < extern void persistfile(char *pfn);
197 > extern void     persistfile(char *pfn);
198   extern void     pfdetach(void);
199   extern void     pfclean(void);
200   extern void     pflock(int lf);
# Line 198 | Line 206 | extern void    free_objmem(void);
206                                          /* defined in preload.c */
207   extern int      load_os(OBJREC *op);
208   extern void     preload_objs(void);
209 + extern char     *shm_boundary;
210 + extern void     cow_memshare(void);
211 + extern void     cow_doneshare(void);
212                                          /* defined in raycalls.c */
213   extern void     ray_init(char *otnm);
214   extern void     ray_trace(RAY *r);
# Line 205 | Line 216 | extern void    ray_done(int freall);
216   extern void     ray_save(RAYPARAMS *rp);
217   extern void     ray_restore(RAYPARAMS *rp);
218   extern void     ray_defaults(RAYPARAMS *rp);
219 + extern void     reset_random(void);
220                                          /* defined in raypcalls.c */
221   extern void     ray_pinit(char *otnm, int nproc);
222   extern int      ray_psend(RAY *r);
# Line 218 | Line 230 | extern int     (*ray_fifo_out)(RAY *r);
230   extern int      ray_fifo_in(RAY *r);
231   extern int      ray_fifo_flush(void);
232                                          /* defined in raytrace.c */
233 < extern int      rayorigin(RAY *r, int rt, const RAY *ro, const COLOR rc);
233 > extern int      rayorigin(RAY *r, int rt, const RAY *ro, const SCOLOR rc);
234   extern void     rayclear(RAY *r);
235   extern void     raytrace(RAY *r);
236 + extern int      rayreject(OBJREC *o, RAY *r, double t, double rod);
237   extern void     rayhit(OBJECT *oset, RAY *r);
238   extern void     raycont(RAY *r);
239   extern void     raytrans(RAY *r);
# Line 229 | Line 242 | extern int     rayshade(RAY *r, int mod);
242   extern void     rayparticipate(RAY *r);
243   extern void     raytexture(RAY *r, OBJECT mod);
244   extern int      raymixture(RAY *r, OBJECT fore, OBJECT back, double coef);
245 < extern void     raycontrib(RREAL rc[3], const RAY *r, int flags);
245 > extern void     raycontrib(SCOLOR rc, const RAY *r, int flags);
246   extern double   raydist(const RAY *r, int flags);
247   extern double   raynormal(FVECT norm, RAY *r);
248   extern void     newrayxf(RAY *r);
249   extern void     flipsurface(RAY *r);
250   extern int      localhit(RAY *r, CUBE *scene);
251                                          /* defined in renderopts.c */
252 + extern int      feature_status(int ac, char *av[]);
253   extern int      getrenderopt(int ac, char *av[]);
254   extern void     print_rdefaults(void);
255                                          /* defined in srcdraw.c */
256 < extern void     drawsources(COLOR *pic[], float *zbf[],
256 > extern void     init_drawsources(int rad);
257 > extern void     drawsources(COLORV *pic[], RGBPRIMP primp, float *zbf[],
258                          int x0, int xsiz, int y0, int ysiz);
244 extern void init_drawsources(int rad);
259                                          /* defined in rt/initotypes.c */
260 < extern void initotypes(void);
260 > extern void     initotypes(void);
261                                          /* module main procedures */
262   extern void     rtrace(char *fname, int nproc);
263 < extern char     *formstr(int  f);
263 > extern const char       *formstr(int  f);
264   extern void     rview(void);
265   extern void     rpict(int seq, char *pout, char *zout, char *prvr);
266  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines