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.47 by greg, Wed Oct 19 21:25:20 2022 UTC vs.
Revision 2.52 by greg, Fri Apr 5 01:10:26 2024 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 61 | Line 67 | typedef struct ray {
67          int     rsrc;           /* source we're aiming for */
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
# Line 92 | 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 */
# Line 217 | Line 225 | extern int     (*ray_fifo_out)(RAY *r);
225   extern int      ray_fifo_in(RAY *r);
226   extern int      ray_fifo_flush(void);
227                                          /* defined in raytrace.c */
228 < extern int      rayorigin(RAY *r, int rt, const RAY *ro, const COLOR rc);
228 > extern int      rayorigin(RAY *r, int rt, const RAY *ro, const SCOLOR rc);
229   extern void     rayclear(RAY *r);
230   extern void     raytrace(RAY *r);
231 < extern int      rayreject(OBJREC *o, RAY *r, double t);
231 > extern int      rayreject(OBJREC *o, RAY *r, double t, double rod);
232   extern void     rayhit(OBJECT *oset, RAY *r);
233   extern void     raycont(RAY *r);
234   extern void     raytrans(RAY *r);
# Line 229 | Line 237 | extern int     rayshade(RAY *r, int mod);
237   extern void     rayparticipate(RAY *r);
238   extern void     raytexture(RAY *r, OBJECT mod);
239   extern int      raymixture(RAY *r, OBJECT fore, OBJECT back, double coef);
240 < extern void     raycontrib(RREAL rc[3], const RAY *r, int flags);
240 > extern void     raycontrib(SCOLOR rc, const RAY *r, int flags);
241   extern double   raydist(const RAY *r, int flags);
242   extern double   raynormal(FVECT norm, RAY *r);
243   extern void     newrayxf(RAY *r);
# Line 247 | Line 255 | extern void    init_drawsources(int rad);
255   extern void     initotypes(void);
256                                          /* module main procedures */
257   extern void     rtrace(char *fname, int nproc);
258 < extern char     *formstr(int  f);
258 > extern const char       *formstr(int  f);
259   extern void     rview(void);
260   extern void     rpict(int seq, char *pout, char *zout, char *prvr);
261  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines