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 1.5 by greg, Thu May 23 08:12:57 1991 UTC vs.
Revision 2.13 by greg, Tue Feb 25 02:47:23 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1990 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   *  ray.h - header file for routines using rays.
7 *
8 *     8/7/85
4   */
5  
6 + #include "copyright.h"
7 +
8   #include  "standard.h"
9  
10 + #include  "octree.h"
11 +
12   #include  "object.h"
13  
14   #include  "color.h"
15  
16 + #define  MAXDIM         32      /* maximum number of dimensions */
17 +
18                                  /* ray type flags */
19   #define  PRIMARY        01              /* original ray */
20   #define  SHADOW         02              /* ray to light source */
# Line 21 | Line 22
22   #define  REFRACTED      010             /* refracted (bent) ray */
23   #define  TRANS          020             /* transmitted/transferred ray */
24   #define  AMBIENT        040             /* ray scattered for interreflection */
25 + #define  SPECULAR       0100            /* ray scattered for specular */
26  
27                                  /* reflected ray types */
28 < #define  RAYREFL        (SHADOW|REFLECTED|AMBIENT)
28 > #define  RAYREFL        (SHADOW|REFLECTED|AMBIENT|SPECULAR)
29  
30   typedef struct ray {
31 <        long  rno;              /* unique ray number */
32 <        int  rlvl;              /* number of reflections for this ray */
33 <        float  rweight;         /* cumulative weight of this ray */
34 <        short  rtype;           /* ray type */
35 <        short  crtype;          /* cumulative ray type */
31 >        unsigned long  rno;     /* unique ray number */
32 >        int     rlvl;           /* number of reflections for this ray */
33 >        float   rweight;        /* cumulative weight of this ray */
34 >        short   rtype;          /* ray type */
35 >        short   crtype;         /* cumulative ray type */
36          struct ray  *parent;    /* ray this originated from */
37 <        FVECT  rorg;            /* origin of ray */
38 <        FVECT  rdir;            /* normalized direction of ray */
39 <        int  rsrc;              /* source we're aiming for */
40 <        OBJECT  *clipset;       /* set of objects currently clipped */
41 <        OBJECT  *newcset;       /* next clipset, used for transmission */
42 <        OBJREC  *ro;            /* intersected object */
43 <        double  rot;            /* distance to object */
44 <        FVECT  rop;             /* intersection point */
45 <        FVECT  ron;             /* intersection surface normal */
46 <        double  rod;            /* -DOT(rdir, ron) */
47 <        FULLXF  *rox;           /* object transformation */
48 <        FVECT  pert;            /* surface normal perturbation */
49 <        COLOR  pcol;            /* pattern color */
50 <        COLOR  rcol;            /* returned ray value */
51 <        double  rt;             /* returned effective ray length */
37 >        FVECT   rorg;           /* origin of ray */
38 >        FVECT   rdir;           /* normalized direction of ray */
39 >        double  rmax;           /* maximum distance (aft clipping plane) */
40 >        int     rsrc;           /* source we're aiming for */
41 >        OBJECT  *clipset;       /* set of objects currently clipped */
42 >        OBJECT  *newcset;       /* next clipset, used for transmission */
43 >        void    (*revf)();      /* evaluation function for this ray */
44 >        OBJECT  robj;           /* intersected object number */
45 >        OBJREC  *ro;            /* intersected object (one with material) */
46 >        double  rot;            /* distance to object */
47 >        FVECT   rop;            /* intersection point */
48 >        FVECT   ron;            /* intersection surface normal */
49 >        double  rod;            /* -DOT(rdir, ron) */
50 >        FULLXF  *rox;           /* object transformation */
51 >        FVECT   pert;           /* surface normal perturbation */
52 >        COLOR   pcol;           /* pattern color */
53 >        COLOR   rcol;           /* returned ray value */
54 >        double  rt;             /* returned effective ray length */
55 >        COLOR   cext;           /* medium extinction coefficient */
56 >        COLOR   albedo;         /* medium scattering albedo */
57 >        float   gecc;           /* scattering eccentricity coefficient */
58 >        int     *slights;       /* list of lights to test for scattering */
59   }  RAY;
60  
61 < extern double  raynormal();
61 > #define  rayvalue(r)    (*(r)->revf)(r)
62  
63 < extern int  dimlist[];          /* dimension list for distribution */
55 < extern int  ndims;              /* number of dimensions so far */
56 < extern int  samplendx;          /* index for this sample */
63 > extern char  VersionID[];       /* Radiance version ID string */
64  
65 < #define  MAXDIM         16      /* maximum number of dimensions */
65 > extern CUBE     thescene;       /* our scene */
66 > extern OBJECT   nsceneobjs;     /* number of objects in our scene */
67 >
68 > extern unsigned long    raynum; /* next ray ID */
69 > extern unsigned long    nrays;  /* total rays traced so far */
70 >
71 > extern OBJREC  Lamb;            /* a Lambertian surface */
72 > extern OBJREC  Aftplane;        /* aft clipping object */
73 >
74 > extern void     (*trace)();     /* global trace reporting callback */
75 >
76 > extern int      dimlist[];      /* dimension list for distribution */
77 > extern int      ndims;          /* number of dimensions so far */
78 > extern int      samplendx;      /* index for this sample */
79 >
80 > extern int      ray_savesiz;    /* size of parameter save buffer */
81 >
82 > extern int      do_irrad;       /* compute irradiance? */
83 >
84 > extern double   dstrsrc;        /* square source distribution */
85 > extern double   shadthresh;     /* shadow threshold */
86 > extern double   shadcert;       /* shadow testing certainty */
87 > extern int      directrelay;    /* number of source relays */
88 > extern int      vspretest;      /* virtual source pretest density */
89 > extern int      directvis;      /* light sources visible to eye? */
90 > extern double   srcsizerat;     /* maximum source size/dist. ratio */
91 >
92 > extern double   specthresh;     /* specular sampling threshold */
93 > extern double   specjitter;     /* specular sampling jitter */
94 >
95 > extern COLOR    cextinction;    /* global extinction coefficient */
96 > extern COLOR    salbedo;        /* global scattering albedo */
97 > extern double   seccg;          /* global scattering eccentricity */
98 > extern double   ssampdist;      /* scatter sampling distance */
99 >
100 > extern int      backvis;        /* back face visibility */
101 >
102 > extern int      maxdepth;       /* maximum recursion depth */
103 > extern double   minweight;      /* minimum ray weight */
104 >
105 > extern char     *ambfile;       /* ambient file name */
106 > extern COLOR    ambval;         /* ambient value */
107 > extern int      ambvwt;         /* initial weight for ambient value */
108 > extern double   ambacc;         /* ambient accuracy */
109 > extern int      ambres;         /* ambient resolution */
110 > extern int      ambdiv;         /* ambient divisions */
111 > extern int      ambssamp;       /* ambient super-samples */
112 > extern int      ambounce;       /* ambient bounces */
113 > extern char     *amblist[];     /* ambient include/exclude list */
114 > extern int      ambincl;        /* include == 1, exclude == 0 */
115 >
116 > extern int      ray_pnprocs;    /* number of child processes */
117 > extern int      ray_pnidle;     /* number of idle processes */
118 >
119 > #define AMBLLEN         128     /* max. ambient list length */
120 > #define AMBWORD         8       /* average word length */
121 >
122 > typedef struct {                /* rendering parameter holder */
123 >        int     do_irrad;
124 >        double  dstrsrc;
125 >        double  shadthresh;
126 >        double  shadcert;
127 >        int     directrelay;
128 >        int     vspretest;
129 >        int     directvis;
130 >        double  srcsizerat;
131 >        COLOR   cextinction;
132 >        COLOR   salbedo;
133 >        double  seccg;
134 >        double  ssampdist;
135 >        double  specthresh;
136 >        double  specjitter;
137 >        int     backvis;
138 >        int     maxdepth;
139 >        double  minweight;
140 >        char    ambfile[512];
141 >        COLOR   ambval;
142 >        int     ambvwt;
143 >        double  ambacc;
144 >        int     ambres;
145 >        int     ambdiv;
146 >        int     ambssamp;
147 >        int     ambounce;
148 >        int     ambincl;
149 >        short   amblndx[AMBLLEN+1];
150 >        char    amblval[AMBLLEN*AMBWORD];
151 > } RAYPARAMS;
152 >
153 > #define rpambmod(p,i)   ( (i)>=AMBLLEN||(p)->amblndx[i]<0 ? \
154 >                          (char *)NULL : (p)->amblval+(p)->amblndx[i] )
155 >
156 > #ifdef NOPROTO
157 >
158 > extern void     headclean();
159 > extern void     openheader();
160 > extern void     dupheader();
161 > extern void     pfdetach();
162 > extern void     pfclean();
163 > extern void     pflock();
164 > extern void     pfhold();
165 > extern void     io_process();
166 > extern int      free_objs();
167 > extern void     free_objmem();
168 > extern int      load_os();
169 > extern void     preload_objs();
170 > extern void     ray_init();
171 > extern void     ray_trace();
172 > extern void     ray_done();
173 > extern void     ray_save();
174 > extern void     ray_restore();
175 > extern void     ray_defaults();
176 > extern void     ray_pinit();
177 > extern void     ray_psend();
178 > extern int      ray_pqueue();
179 > extern int      ray_presult();
180 > extern void     ray_pdone();
181 > extern void     ray_popen();
182 > extern void     ray_pclose();
183 > extern int      rayorigin();
184 > extern void     rayclear();
185 > extern void     raytrace();
186 > extern void     raycont();
187 > extern void     raytrans();
188 > extern int      rayshade();
189 > extern void     rayparticipate();
190 > extern int      raymixture();
191 > extern double   raydist();
192 > extern double   raynormal();
193 > extern void     newrayxf();
194 > extern void     flipsurface();
195 > extern int      localhit();
196 > extern int      getrenderopt();
197 > extern void     print_rdefaults();
198 > extern void     drawsources();
199 > extern void     rtrace();
200 > extern void     rview();
201 > extern void     rpict();
202 >
203 > #else
204 >                                        /* defined in duphead.c */
205 > extern void     headclean(void);
206 > extern void     openheader(void);
207 > extern void     dupheader(void);
208 > extern void     pfdetach(void);
209 > extern void     pfclean(void);
210 > extern void     pflock(int lf);
211 > extern void     pfhold(void);
212 > extern void     io_process(void);
213 >                                        /* defined in freeobjmem.c */
214 > extern int      free_objs(OBJECT on, OBJECT no);
215 > extern void     free_objmem(void);
216 >                                        /* defined in preload.c */
217 > extern int      load_os(OBJREC *op);
218 > extern void     preload_objs(void);
219 >                                        /* defined in raycalls.c */
220 > extern void     ray_init(char *otnm);
221 > extern void     ray_trace(RAY *r);
222 > extern void     ray_done(int freall);
223 > extern void     ray_save(RAYPARAMS *rp);
224 > extern void     ray_restore(RAYPARAMS *rp);
225 > extern void     ray_defaults(RAYPARAMS *rp);
226 >                                        /* defined in raypcalls.c */
227 > extern void     ray_pinit(char *otnm, int nproc);
228 > extern void     ray_psend(RAY *r);
229 > extern int      ray_pqueue(RAY *r);
230 > extern int      ray_presult(RAY *r, int poll);
231 > extern void     ray_pdone(int freall);
232 > extern void     ray_popen(int nadd);
233 > extern void     ray_pclose(int nsub);
234 >                                        /* defined in raytrace.c */
235 > extern int      rayorigin(RAY *r, RAY *ro, int rt, double rw);
236 > extern void     rayclear(RAY *r);
237 > extern void     raytrace(RAY *r);
238 > extern void     raycont(RAY *r);
239 > extern void     raytrans(RAY *r);
240 > extern int      rayshade(RAY *r, int mod);
241 > extern void     rayparticipate(RAY *r);
242 > extern int      raymixture(RAY *r, OBJECT fore, OBJECT back, double coef);
243 > extern double   raydist(RAY *r, int flags);
244 > extern double   raynormal(FVECT norm, RAY *r);
245 > extern void     newrayxf(RAY *r);
246 > extern void     flipsurface(RAY *r);
247 > extern int      localhit(RAY *r, CUBE *scene);
248 >                                        /* defined in renderopts.c */
249 > extern int      getrenderopt(int ac, char *av[]);
250 > extern void     print_rdefaults(void);
251 >                                        /* defined in srcdraw.c */
252 > extern void     drawsources(COLOR *pic[], float *zbf[],
253 >                        int x0, int xsiz, int y0, int ysiz);
254 >                                        /* module main procedures */
255 > extern void     rtrace(char *fname);
256 > extern void     rview(void);
257 > extern void     rpict(int seq, char *pout, char *zout, char *prvr);
258 >
259 > #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines