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

Comparing ray/src/rt/source.h (file contents):
Revision 2.12 by greg, Wed Dec 31 01:50:02 2003 UTC vs.
Revision 2.28 by greg, Wed Oct 22 16:39:58 2025 UTC

# Line 19 | Line 19 | extern "C" {
19   #ifndef  SHADCACHE
20   #define  SHADCACHE      20              /* shadow cache resolution */
21   #endif
22 + #ifndef  MINSHADCNT
23 + #define  MINSHADCNT     2               /* test at least this many shadows */
24 + #endif
25  
26   #define  SDISTANT       01              /* source distant flag */
27   #define  SSKIP          02              /* source skip flag */
# Line 26 | Line 29 | extern "C" {
29   #define  SSPOT          010             /* source spotlight flag */
30   #define  SVIRTUAL       020             /* source virtual flag */
31   #define  SFLAT          040             /* source flat flag */
32 < #define  SCYL           0100            /* source cylindrical flag */
33 < #define  SFOLLOW        0200            /* source follow path flag */
32 > #define  SCIR           0100            /* source circular flag */
33 > #define  SCYL           0200            /* source cylindrical flag */
34 > #define  SFOLLOW        0400            /* source follow path flag */
35  
36   typedef struct {
37          FVECT  aim;             /* aim direction or center */
# Line 50 | Line 54 | typedef struct {
54   }  OBSCACHE;            /* obstructor cache */
55  
56   typedef struct {
53        int  sflags;            /* source flags */
57          FVECT  sloc;            /* direction or position of source */
58          FVECT  ss[3];           /* source dimension vectors, U, V, and W */
59          float  srad;            /* maximum source radius */
# Line 69 | Line 72 | typedef struct {
72          } sa;                   /* source aiming information */
73          unsigned long
74                  ntests, nhits;  /* shadow tests and hits */
75 < #ifdef  SHADCACHE
75 > #if  SHADCACHE
76          OBSCACHE  *obscache;    /* obstructor cache */
77   #endif
78 +        int  sflags;            /* source flags */
79   }  SRCREC;              /* light source */
80  
81   #define MAXSPART        64              /* maximum partitions per source */
# Line 84 | Line 88 | typedef struct {
88   #define snorm           ss[SW]          /* normal vector for flat source */
89  
90   typedef struct {
91 +        double  dom;                            /* solid angle of partition */
92          int  sn;                                /* source number */
93          short  np;                              /* number of partitions */
94          short  sp;                              /* this partition number */
90        double  dom;                            /* solid angle of partition */
95          unsigned char  spt[MAXSPART/2];         /* source partitioning */
96   }  SRCINDEX;            /* source index structure */
97  
# Line 113 | Line 117 | typedef struct {
117   *                              i passed to vproj runs from 0 to nproj-1.
118   */
119  
120 < typedef struct {
121 <        int  (*vproj)();        /* project virtual sources */
120 > typedef struct {                /* project virtual sources */
121 >        int  (*vproj)(MAT4,OBJREC*,SRCREC*,int);
122          int  nproj;             /* number of possible projections */
123   } VSMATERIAL;           /* virtual source material functions */
124  
125   typedef struct {
126 <        void    (*setsrc)();    /* set light source for object */
127 <        void    (*partit)();    /* partition light source object */
128 <        double  (*getpleq)();   /* plane equation for surface */
129 <        double  (*getdisk)();   /* maximum disk for surface */
126 >        void    (*setsrc)(SRCREC*,OBJREC*);     /* set light source for object */
127 >        void    (*partit)(SRCINDEX*,RAY*);      /* partition light source object */
128 >        double  (*getpleq)(FVECT,OBJREC*);      /* plane equation for surface */
129 >        double  (*getdisk)(FVECT,OBJREC*);      /* maximum disk for surface */
130   } SOBJECT;              /* source object functions */
131  
132   typedef union {
# Line 142 | Line 146 | extern int  nsources;                  /* the number of sources */
146   #define  setsource(s,o)         (*sfun[(o)->otype].of->setsrc)(s,o)
147  
148                                          /* defined in source.c */
145 extern OBJREC   *findmaterial(OBJREC *o);
149   extern void     marksources(void);
150 + extern void     distantsources(void);
151   extern void     freesources(void);
152   extern int      srcray(RAY *sr, RAY *r, SRCINDEX *si);
153   extern void     srcvalue(RAY *r);
154   extern int      sourcehit(RAY *r);
155 < extern void     direct(RAY *r, void (*f)(), char *p);
155 > typedef void srcdirf_t(SCOLOR cv, void *np, FVECT ldir, double omega);
156 > extern void     direct(RAY *r, srcdirf_t *f, void *p);
157   extern void     srcscatter(RAY *r);
158   extern int      m_light(OBJREC *m, RAY *r);
159 < extern void     srcblocker(RAY *r);
159 >                                        /* defined in srcobstr.c */
160 > extern void     initobscache(int sn);
161 > extern int      srcblocker(RAY *r);
162   extern int      srcblocked(RAY *r);
163   extern void     freeobscache(SRCREC *s);
164 + extern void     markclip(OBJREC *m);
165                                          /* defined in srcsamp.c */
166 + extern int      srcskip(int sn, RAY *r);
167   extern double   nextssamp(RAY *r, SRCINDEX *si);
168   extern int      skipparts(int ct[3], int sz[3], int pp[2], unsigned char *pt);
169   extern void     nopart(SRCINDEX *si, RAY *r);
170   extern void     cylpart(SRCINDEX *si, RAY *r);
171   extern void     flatpart(SRCINDEX *si, RAY *r);
172   extern double   scylform(int sn, FVECT dir);
173 +                                        /* defined in srcskipload.c */
174 + extern int      sskip_dim[2];           /* source skip image size */
175 + extern int      srcskip_open(char *bmpspec, char *scorrimg);
176 + extern int      srcskip_getrow(int row, int *sndx, float *scorr);
177 + extern int      *srcskip_ndxmap(void);
178 + extern float    *srcskip_corrmap(void);
179 + extern void     srcskip_close(void);
180 + extern void     srcskip_free_maps(void);
181                                          /* defined in srcsupp.c */
182   extern void     initstypes(void);
183   extern int      newsource(void);

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)