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

Comparing ray/src/rt/source.h (file contents):
Revision 1.7 by greg, Thu Jun 20 09:03:21 1991 UTC vs.
Revision 1.13 by greg, Thu Jul 18 14:43:06 1991 UTC

# Line 36 | Line 36 | typedef struct {
36          } sl;                   /* localized source information */
37          union {
38                  int  success;           /* successes - AIMREQT*failures */
39 <                int  svnext;            /* next source to aim for */
39 >                struct {
40 >                        short  pn;              /* projection number */
41 >                        short  sn;              /* next source to aim for */
42 >                }  sv;                  /* virtual source */
43          } sa;                   /* source aiming information */
44          long  ntests, nhits;    /* shadow tests and hits */
45          OBJREC  *so;            /* source destination object */
46   }  SRCREC;              /* light source */
47  
48 + /*
49 + * Special support functions for sources
50 + */
51 +
52 + /*
53 + * Virtual source materials must define the following.
54 + *
55 + *      vproj(pm, op, sp, i)    Compute i'th virtual projection
56 + *                              of source sp in object op and assign
57 + *                              the 4x4 transformation matrix pm.
58 + *                              Return 1 on success, 0 if no i'th projection.
59 + *
60 + *      nproj                   The number of projections.  The value of
61 + *                              i passed to vproj runs from 0 to nproj-1.
62 + */
63 +
64   typedef struct {
65 <        FVECT  dir;             /* source direction */
66 <        COLOR  coef;            /* material coefficient */
67 <        COLOR  val;             /* contribution */
49 < }  CONTRIB;             /* direct contribution */
65 >        int  (*vproj)();        /* project virtual sources */
66 >        int  nproj;             /* number of possible projections */
67 > } VSMATERIAL;           /* virtual source material functions */
68  
69   typedef struct {
70 <        int  sno;               /* source number */
71 <        float  brt;             /* brightness (for comparison) */
72 < }  CNTPTR;              /* contribution pointer */
70 >        int     (*setsrc)();    /* set light source for object */
71 >        double  (*getpleq)();   /* plane equation for surface */
72 >        double  (*getdisk)();   /* maximum disk for surface */
73 > } SOBJECT;              /* source object functions */
74  
75 + typedef union {
76 +        VSMATERIAL  *mf;        /* material functions */
77 +        SOBJECT  *of;           /* object functions */
78 + } SRCFUNC;              /* source functions */
79 +
80 + extern SRCFUNC  sfun[];                 /* source dispatch table */
81 +
82   extern SRCREC  *source;                 /* our source list */
83   extern int  nsources;                   /* the number of sources */
84  
85   extern double  srcray();                /* ray to source */
86 + extern int  srcvalue();                 /* compute source value w/o shadows */
87  
88 + extern double  intercircle();           /* intersect two circles */
89 + extern double  spotdisk();              /* intersecting disk for spot */
90 + extern double  beamdisk();              /* intersecting disk for beam */
91 +
92   extern SPOT  *makespot();               /* make spotlight */
93  
94 < extern SRCREC  *newsource();            /* allocate new source */
94 > extern double  dstrsrc;                 /* source distribution amount */
95 > extern double  shadthresh;              /* relative shadow threshold */
96 > extern double  shadcert;                /* shadow testing certainty */
97 > extern int  directrelay;                /* maximum number of source relays */
98 > extern int  vspretest;                  /* virtual source pretest density */
99 > extern int  directinvis;                /* sources invisible? */
100 >
101 > #define  getplaneq(c,o)         (*sfun[(o)->otype].of->getpleq)(c,o)
102 > #define  getmaxdisk(c,o)        (*sfun[(o)->otype].of->getdisk)(c,o)
103 > #define  setsource(s,o)         (*sfun[(o)->otype].of->setsrc)(s,o)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines