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

Comparing ray/src/rt/srcsupp.c (file contents):
Revision 2.1 by greg, Tue Nov 12 17:10:22 1991 UTC vs.
Revision 2.21 by greg, Thu Dec 4 05:26:28 2014 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   *  Support routines for source objects and materials
6 + *
7 + *  External symbols declared in source.h
8   */
9  
10 + #include "copyright.h"
11 +
12   #include  "ray.h"
13  
14   #include  "otypes.h"
# Line 18 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19  
20   #include  "face.h"
21  
22 < #define SRCINC          4               /* realloc increment for array */
22 > #define SRCINC          32              /* realloc increment for array */
23  
24   SRCREC  *source = NULL;                 /* our list of sources */
25   int  nsources = 0;                      /* the number of sources */
# Line 26 | Line 27 | int  nsources = 0;                     /* the number of sources */
27   SRCFUNC  sfun[NUMOTYPE];                /* source dispatch table */
28  
29  
30 < initstypes()                    /* initialize source dispatch table */
30 > void
31 > initstypes(void)                        /* initialize source dispatch table */
32   {
33          extern VSMATERIAL  mirror_vs, direct1_vs, direct2_vs;
32        extern int  fsetsrc(), ssetsrc(), sphsetsrc(), cylsetsrc(), rsetsrc();
33        extern int  nopart(), flatpart(), cylpart();
34        extern double  fgetplaneq(), rgetplaneq();
35        extern double  fgetmaxdisk(), rgetmaxdisk();
34          static SOBJECT  fsobj = {fsetsrc, flatpart, fgetplaneq, fgetmaxdisk};
35          static SOBJECT  ssobj = {ssetsrc, nopart};
36          static SOBJECT  sphsobj = {sphsetsrc, nopart};
# Line 51 | Line 49 | initstypes()                   /* initialize source dispatch table */
49  
50  
51   int
52 < newsource()                     /* allocate new source in our array */
52 > newsource(void)                 /* allocate new source in our array */
53   {
54          if (nsources == 0)
55                  source = (SRCREC *)malloc(SRCINC*sizeof(SRCREC));
56          else if (nsources%SRCINC == 0)
57 <                source = (SRCREC *)realloc((char *)source,
57 >                source = (SRCREC *)realloc((void *)source,
58                                  (unsigned)(nsources+SRCINC)*sizeof(SRCREC));
59          if (source == NULL)
60                  return(-1);
61          source[nsources].sflags = 0;
62          source[nsources].nhits = 1;
63 <        source[nsources].ntests = 2;    /* initial hit probability = 1/2 */
63 >        source[nsources].ntests = 2;    /* initial hit probability = 50% */
64 > #if SHADCACHE
65 >        source[nsources].obscache = NULL;
66 > #endif
67          return(nsources++);
68   }
69  
70  
71 < setflatss(src)                          /* set sampling for a flat source */
72 < register SRCREC  *src;
71 > void
72 > setflatss(                              /* set sampling for a flat source */
73 >        SRCREC  *src
74 > )
75   {
76          double  mult;
77 <        register int  i;
77 >        int  i;
78  
79 <        src->ss[SV][0] = src->ss[SV][1] = src->ss[SV][2] = 0.0;
79 >        getperpendicular(src->ss[SU], src->snorm);
80 >        mult = .5 * sqrt( src->ss2 );
81          for (i = 0; i < 3; i++)
78                if (src->snorm[i] < 0.6 && src->snorm[i] > -0.6)
79                        break;
80        src->ss[SV][i] = 1.0;
81        fcross(src->ss[SU], src->ss[SV], src->snorm);
82        mult = .5 * sqrt( src->ss2 / DOT(src->ss[SU],src->ss[SU]) );
83        for (i = 0; i < 3; i++)
82                  src->ss[SU][i] *= mult;
83          fcross(src->ss[SV], src->snorm, src->ss[SU]);
84   }
85  
86  
87 < fsetsrc(src, so)                        /* set a face as a source */
88 < register SRCREC  *src;
89 < OBJREC  *so;
87 > void
88 > fsetsrc(                        /* set a face as a source */
89 >        SRCREC  *src,
90 >        OBJREC  *so
91 > )
92   {
93 <        register FACE  *f;
94 <        register int  i, j;
93 >        FACE  *f;
94 >        int  i, j;
95          double  d;
96          
97          src->sa.success = 2*AIMREQT-1;          /* bitch on second failure */
98          src->so = so;
99                                                  /* get the face */
100          f = getface(so);
101 +        if (f->area == 0.0)
102 +                objerror(so, USER, "zero source area");
103                                                  /* find the center */
104          for (j = 0; j < 3; j++) {
105                  src->sloc[j] = 0.0;
# Line 106 | Line 108 | OBJREC  *so;
108                  src->sloc[j] /= (double)f->nv;
109          }
110          if (!inface(src->sloc, f))
111 <                objerror(so, USER, "cannot hit center");
111 >                objerror(so, USER, "cannot hit source center");
112          src->sflags |= SFLAT;
113          VCOPY(src->snorm, f->norm);
114          src->ss2 = f->area;
# Line 119 | Line 121 | OBJREC  *so;
121          }
122          src->srad = sqrt(src->srad);
123                                                  /* compute size vectors */
124 <        if (f->nv == 4 || (f->nv == 5 &&        /* parallelogram case */
123 <                        dist2(VERTEX(f,0),VERTEX(f,4)) <= FTINY*FTINY))
124 >        if (f->nv == 4)                         /* parallelogram case */
125                  for (j = 0; j < 3; j++) {
126                          src->ss[SU][j] = .5*(VERTEX(f,1)[j]-VERTEX(f,0)[j]);
127                          src->ss[SV][j] = .5*(VERTEX(f,3)[j]-VERTEX(f,0)[j]);
# Line 130 | Line 131 | OBJREC  *so;
131   }
132  
133  
134 < ssetsrc(src, so)                        /* set a source as a source */
135 < register SRCREC  *src;
136 < register OBJREC  *so;
134 > void
135 > ssetsrc(                        /* set a source as a source */
136 >        SRCREC  *src,
137 >        OBJREC  *so
138 > )
139   {
140          double  theta;
141          
# Line 140 | Line 143 | register OBJREC  *so;
143          src->so = so;
144          if (so->oargs.nfargs != 4)
145                  objerror(so, USER, "bad arguments");
146 <        src->sflags |= SDISTANT;
146 >        src->sflags |= (SDISTANT|SCIR);
147          VCOPY(src->sloc, so->oargs.farg);
148          if (normalize(src->sloc) == 0.0)
149                  objerror(so, USER, "zero direction");
# Line 156 | Line 159 | register OBJREC  *so;
159   }
160  
161  
162 < sphsetsrc(src, so)                      /* set a sphere as a source */
163 < register SRCREC  *src;
164 < register OBJREC  *so;
162 > void
163 > sphsetsrc(                      /* set a sphere as a source */
164 >        SRCREC  *src,
165 >        OBJREC  *so
166 > )
167   {
168 <        register int  i;
168 >        int  i;
169  
170          src->sa.success = 2*AIMREQT-1;          /* bitch on second failure */
171          src->so = so;
172          if (so->oargs.nfargs != 4)
173                  objerror(so, USER, "bad # arguments");
174          if (so->oargs.farg[3] <= FTINY)
175 <                objerror(so, USER, "illegal radius");
175 >                objerror(so, USER, "illegal source radius");
176 >        src->sflags |= SCIR;
177          VCOPY(src->sloc, so->oargs.farg);
178          src->srad = so->oargs.farg[3];
179          src->ss2 = PI * src->srad * src->srad;
180          for (i = 0; i < 3; i++)
181                  src->ss[SU][i] = src->ss[SV][i] = src->ss[SW][i] = 0.0;
182          for (i = 0; i < 3; i++)
183 <                src->ss[i][i] = .7236 * so->oargs.farg[3];
183 >                src->ss[i][i] = 0.7236 * so->oargs.farg[3];
184   }
185  
186  
187 < rsetsrc(src, so)                        /* set a ring (disk) as a source */
188 < register SRCREC  *src;
189 < OBJREC  *so;
187 > void
188 > rsetsrc(                        /* set a ring (disk) as a source */
189 >        SRCREC  *src,
190 >        OBJREC  *so
191 > )
192   {
193 <        register CONE  *co;
193 >        CONE  *co;
194          
195          src->sa.success = 2*AIMREQT-1;          /* bitch on second failure */
196          src->so = so;
197                                                  /* get the ring */
198          co = getcone(so, 0);
199 +        if (CO_R1(co) <= FTINY)
200 +                objerror(so, USER, "illegal source radius");
201          VCOPY(src->sloc, CO_P0(co));
202          if (CO_R0(co) > 0.0)
203 <                objerror(so, USER, "cannot hit center");
204 <        src->sflags |= SFLAT;
203 >                objerror(so, USER, "cannot hit source center");
204 >        src->sflags |= (SFLAT|SCIR);
205          VCOPY(src->snorm, co->ad);
206          src->srad = CO_R1(co);
207          src->ss2 = PI * src->srad * src->srad;
# Line 199 | Line 209 | OBJREC  *so;
209   }
210  
211  
212 < cylsetsrc(src, so)                      /* set a cylinder as a source */
213 < register SRCREC  *src;
214 < OBJREC  *so;
212 > void
213 > cylsetsrc(                      /* set a cylinder as a source */
214 >        SRCREC  *src,
215 >        OBJREC  *so
216 > )
217   {
218 <        register CONE  *co;
219 <        register int  i;
218 >        CONE  *co;
219 >        int  i;
220          
221          src->sa.success = 4*AIMREQT-1;          /* bitch on fourth failure */
222          src->so = so;
223                                                  /* get the cylinder */
224          co = getcone(so, 0);
225 +        if (CO_R0(co) <= FTINY)
226 +                objerror(so, USER, "illegal source radius");
227          if (CO_R0(co) > .2*co->al)              /* heuristic constraint */
228                  objerror(so, WARNING, "source aspect too small");
229          src->sflags |= SCYL;
# Line 220 | Line 234 | OBJREC  *so;
234                                                  /* set sampling vectors */
235          for (i = 0; i < 3; i++)
236                  src->ss[SU][i] = .5 * co->al * co->ad[i];
237 <        src->ss[SV][0] = src->ss[SV][1] = src->ss[SV][2] = 0.0;
237 >        getperpendicular(src->ss[SW], co->ad);
238          for (i = 0; i < 3; i++)
225                if (co->ad[i] < 0.6 && co->ad[i] > -0.6)
226                        break;
227        src->ss[SV][i] = 1.0;
228        fcross(src->ss[SW], src->ss[SV], co->ad);
229        normalize(src->ss[SW]);
230        for (i = 0; i < 3; i++)
239                  src->ss[SW][i] *= .8559 * CO_R0(co);
240          fcross(src->ss[SV], src->ss[SW], co->ad);
241   }
242  
243  
244   SPOT *
245 < makespot(m)                     /* make a spotlight */
246 < register OBJREC  *m;
245 > makespot(                       /* make a spotlight */
246 >        OBJREC  *m
247 > )
248   {
249 <        register SPOT  *ns;
249 >        SPOT  *ns;
250  
251 +        if ((ns = (SPOT *)m->os) != NULL)
252 +                return(ns);
253          if ((ns = (SPOT *)malloc(sizeof(SPOT))) == NULL)
254                  return(NULL);
255 +        if (m->oargs.farg[3] <= FTINY)
256 +                objerror(m, USER, "zero angle");
257          ns->siz = 2.0*PI * (1.0 - cos(PI/180.0/2.0 * m->oargs.farg[3]));
258          VCOPY(ns->aim, m->oargs.farg+4);
259          if ((ns->flen = normalize(ns->aim)) == 0.0)
260                  objerror(m, USER, "zero focus vector");
261 +        m->os = (char *)ns;
262          return(ns);
263   }
264  
265  
266 + int
267 + spotout(                        /* check if we're outside spot region */
268 +        RAY  *r,
269 +        SPOT  *s
270 + )
271 + {
272 +        double  d;
273 +        FVECT  vd;
274 +        
275 +        if (s == NULL)
276 +                return(0);
277 +        if (s->flen < -FTINY) {         /* distant source */
278 +                vd[0] = s->aim[0] - r->rorg[0];
279 +                vd[1] = s->aim[1] - r->rorg[1];
280 +                vd[2] = s->aim[2] - r->rorg[2];
281 +                d = DOT(r->rdir,vd);
282 +                /*                      wrong side?
283 +                if (d <= FTINY)
284 +                        return(1);      */
285 +                d = DOT(vd,vd) - d*d;
286 +                if (PI*d > s->siz)
287 +                        return(1);      /* out */
288 +                return(0);      /* OK */
289 +        }
290 +                                        /* local source */
291 +        if (s->siz < 2.0*PI * (1.0 + DOT(s->aim,r->rdir)))
292 +                return(1);      /* out */
293 +        return(0);      /* OK */
294 + }
295 +
296 +
297   double
298 < fgetmaxdisk(ocent, op)          /* get center and squared radius of face */
299 < FVECT  ocent;
300 < OBJREC  *op;
298 > fgetmaxdisk(            /* get center and squared radius of face */
299 >        FVECT  ocent,
300 >        OBJREC  *op
301 > )
302   {
303          double  maxrad2;
304          double  d;
305 <        register int  i, j;
306 <        register FACE  *f;
305 >        int  i, j;
306 >        FACE  *f;
307          
308          f = getface(op);
309          if (f->area == 0.)
# Line 282 | Line 328 | OBJREC  *op;
328  
329  
330   double
331 < rgetmaxdisk(ocent, op)          /* get center and squared radius of ring */
332 < FVECT  ocent;
333 < OBJREC  *op;
331 > rgetmaxdisk(            /* get center and squared radius of ring */
332 >        FVECT  ocent,
333 >        OBJREC  *op
334 > )
335   {
336 <        register CONE  *co;
336 >        CONE  *co;
337          
338          co = getcone(op, 0);
339          VCOPY(ocent, CO_P0(co));
# Line 295 | Line 342 | OBJREC  *op;
342  
343  
344   double
345 < fgetplaneq(nvec, op)                    /* get plane equation for face */
346 < FVECT  nvec;
347 < OBJREC  *op;
345 > fgetplaneq(                     /* get plane equation for face */
346 >        FVECT  nvec,
347 >        OBJREC  *op
348 > )
349   {
350 <        register FACE  *fo;
350 >        FACE  *fo;
351  
352          fo = getface(op);
353          VCOPY(nvec, fo->norm);
# Line 308 | Line 356 | OBJREC  *op;
356  
357  
358   double
359 < rgetplaneq(nvec, op)                    /* get plane equation for ring */
360 < FVECT  nvec;
361 < OBJREC  *op;
359 > rgetplaneq(                     /* get plane equation for ring */
360 >        FVECT  nvec,
361 >        OBJREC  *op
362 > )
363   {
364 <        register CONE  *co;
364 >        CONE  *co;
365  
366          co = getcone(op, 0);
367          VCOPY(nvec, co->ad);
# Line 320 | Line 369 | OBJREC  *op;
369   }
370  
371  
372 < commonspot(sp1, sp2, org)       /* set sp1 to intersection of sp1 and sp2 */
373 < register SPOT  *sp1, *sp2;
374 < FVECT  org;
372 > int
373 > commonspot(             /* set sp1 to intersection of sp1 and sp2 */
374 >        SPOT  *sp1,
375 >        SPOT  *sp2,
376 >        FVECT  org
377 > )
378   {
379          FVECT  cent;
380          double  rad2, cos1, cos2;
# Line 343 | Line 395 | FVECT  org;
395   }
396  
397  
398 < commonbeam(sp1, sp2, dir)       /* set sp1 to intersection of sp1 and sp2 */
399 < register SPOT  *sp1, *sp2;
400 < FVECT  dir;
398 > int
399 > commonbeam(             /* set sp1 to intersection of sp1 and sp2 */
400 >        SPOT  *sp1,
401 >        SPOT  *sp2,
402 >        FVECT  dir
403 > )
404   {
405          FVECT  cent, c1, c2;
406          double  rad2, d;
352        register int  i;
407                                          /* move centers to common plane */
408          d = DOT(sp1->aim, dir);
409 <        for (i = 0; i < 3; i++)
356 <                c1[i] = sp1->aim[i] - d*dir[i];
409 >        VSUM(c1, sp1->aim, dir, -d);
410          d = DOT(sp2->aim, dir);
411 <        for (i = 0; i < 3; i++)
359 <                c2[i] = sp2->aim[i] - d*dir[i];
411 >        VSUM(c2, sp2->aim, dir, -d);
412                                          /* compute overlap */
413          rad2 = intercircle(cent, c1, c2, sp1->siz/PI, sp2->siz/PI);
414          if (rad2 <= FTINY)
# Line 367 | Line 419 | FVECT  dir;
419   }
420  
421  
422 < checkspot(sp, nrm)              /* check spotlight for behind source */
423 < register SPOT  *sp;     /* spotlight */
424 < FVECT  nrm;             /* source surface normal */
422 > int
423 > checkspot(                      /* check spotlight for behind source */
424 >        SPOT  *sp,      /* spotlight */
425 >        FVECT  nrm      /* source surface normal */
426 > )
427   {
428          double  d, d1;
429  
# Line 383 | Line 437 | FVECT  nrm;            /* source surface normal */
437  
438  
439   double
440 < spotdisk(oc, op, sp, pos)       /* intersect spot with object op */
441 < FVECT  oc;
442 < OBJREC  *op;
443 < register SPOT  *sp;
444 < FVECT  pos;
440 > spotdisk(               /* intersect spot with object op */
441 >        FVECT  oc,
442 >        OBJREC  *op,
443 >        SPOT  *sp,
444 >        FVECT  pos
445 > )
446   {
447          FVECT  onorm;
448          double  offs, d, dist;
394        register int  i;
449  
450          offs = getplaneq(onorm, op);
451          d = -DOT(onorm, sp->aim);
# Line 400 | Line 454 | FVECT  pos;
454          dist = (DOT(pos, onorm) - offs)/d;
455          if (dist < 0.)
456                  return(0.);
457 <        for (i = 0; i < 3; i++)
404 <                oc[i] = pos[i] + dist*sp->aim[i];
457 >        VSUM(oc, pos, sp->aim, dist);
458          return(sp->siz*dist*dist/PI/(d*d));
459   }
460  
461  
462   double
463 < beamdisk(oc, op, sp, dir)       /* intersect beam with object op */
464 < FVECT  oc;
465 < OBJREC  *op;
466 < register SPOT  *sp;
467 < FVECT  dir;
463 > beamdisk(               /* intersect beam with object op */
464 >        FVECT  oc,
465 >        OBJREC  *op,
466 >        SPOT  *sp,
467 >        FVECT  dir
468 > )
469   {
470          FVECT  onorm;
471          double  offs, d, dist;
418        register int  i;
472  
473          offs = getplaneq(onorm, op);
474          d = -DOT(onorm, dir);
475          if (d >= -FTINY && d <= FTINY)
476                  return(0.);
477          dist = (DOT(sp->aim, onorm) - offs)/d;
478 <        for (i = 0; i < 3; i++)
426 <                oc[i] = sp->aim[i] + dist*dir[i];
478 >        VSUM(oc, sp->aim, dir, dist);
479          return(sp->siz/PI/(d*d));
480   }
481  
482  
483   double
484 < intercircle(cc, c1, c2, r1s, r2s)       /* intersect two circles */
485 < FVECT  cc;                      /* midpoint (return value) */
486 < FVECT  c1, c2;                  /* circle centers */
487 < double  r1s, r2s;               /* radii squared */
484 > intercircle(                            /* intersect two circles */
485 >        FVECT  cc,              /* midpoint (return value) */
486 >        FVECT  c1,              /* circle centers */
487 >        FVECT  c2,
488 >        double  r1s,            /* radii squared */
489 >        double  r2s
490 > )
491   {
492          double  a2, d2, l;
493          FVECT  disp;
439        register int  i;
494  
495 <        for (i = 0; i < 3; i++)
442 <                disp[i] = c2[i] - c1[i];
495 >        VSUB(disp, c2, c1);
496          d2 = DOT(disp,disp);
497                                          /* circle within overlap? */
498          if (r1s < r2s) {
# Line 459 | Line 512 | double  r1s, r2s;              /* radii squared */
512                  return(0.);
513                                          /* overlap, compute center */
514          l = sqrt((r1s - a2)/d2);
515 <        for (i = 0; i < 3; i++)
463 <                cc[i] = c1[i] + l*disp[i];
515 >        VSUM(cc, c1, disp, l);
516          return(a2);
465 }
466
467
468 sourcehit(r)                    /* check to see if ray hit distant source */
469 register RAY  *r;
470 {
471        int  first, last;
472        register int  i;
473
474        if (r->rsrc >= 0) {             /* check only one if aimed */
475                first = last = r->rsrc;
476        } else {                        /* otherwise check all */
477                first = 0; last = nsources-1;
478        }
479        for (i = first; i <= last; i++)
480                if ((source[i].sflags & (SDISTANT|SVIRTUAL)) == SDISTANT)
481                        /*
482                         * Check to see if ray is within
483                         * solid angle of source.
484                         */
485                        if (2.0*PI * (1.0 - DOT(source[i].sloc,r->rdir))
486                                        <= source[i].ss2) {
487                                r->ro = source[i].so;
488                                if (!(source[i].sflags & SSKIP))
489                                        break;
490                        }
491
492        if (r->ro != NULL) {
493                for (i = 0; i < 3; i++)
494                        r->ron[i] = -r->rdir[i];
495                r->rod = 1.0;
496                r->rox = NULL;
497                return(1);
498        }
499        return(0);
500 }
501
502
503 /****************************************************************
504 * The following macros were separated from the m_light() routine
505 * because they are very nasty and difficult to understand.
506 */
507
508 /* wrongillum *
509 *
510 * We cannot allow an illum to pass to another illum, because that
511 * would almost certainly constitute overcounting.
512 * However, we do allow an illum to pass to another illum
513 * that is actually going to relay to a virtual light source.
514 */
515
516 #define  wrongillum(m, r)       (!(source[r->rsrc].sflags&SVIRTUAL) && \
517                        objptr(source[r->rsrc].so->omod)->otype==MAT_ILLUM)
518
519 /* wrongsource *
520 *
521 * This source is the wrong source (ie. overcounted) if we are
522 * aimed to a different source than the one we hit and the one
523 * we hit is not an illum which should be passed.
524 */
525
526 #define  wrongsource(m, r)      (r->rsrc>=0 && source[r->rsrc].so!=r->ro && \
527                                (m->otype!=MAT_ILLUM || wrongillum(m,r)))
528
529 /* distglow *
530 *
531 * A distant glow is an object that sometimes acts as a light source,
532 * but is too far away from the test point to be one in this case.
533 */
534
535 #define  distglow(m, r)         (m->otype==MAT_GLOW && \
536                                r->rot > m->oargs.farg[3])
537
538 /* badambient *
539 *
540 * We must avoid including counting light sources in the ambient calculation,
541 * since the direct component is handled separately.  Therefore, any
542 * ambient ray which hits an active light source must be discarded.
543 */
544
545 #define  badambient(m, r)       ((r->crtype&(AMBIENT|SHADOW))==AMBIENT && \
546                                !distglow(m, r))
547
548 /* passillum *
549 *
550 * An illum passes to another material type when we didn't hit it
551 * on purpose (as part of a direct calculation), or it is relaying
552 * a virtual light source.
553 */
554
555 #define  passillum(m, r)        (m->otype==MAT_ILLUM && \
556                                (r->rsrc<0 || source[r->rsrc].so!=r->ro || \
557                                source[r->rsrc].sflags&SVIRTUAL))
558
559 /* srcignore *
560 *
561 * The -di flag renders light sources invisible, and here is the test.
562 */
563
564 #define  srcignore(m, r)        (directinvis && !(r->crtype&SHADOW) && \
565                                !distglow(m, r))
566
567
568 m_light(m, r)                   /* ray hit a light source */
569 register OBJREC  *m;
570 register RAY  *r;
571 {
572                                                /* check for over-counting */
573        if (wrongsource(m, r) || badambient(m, r))
574                return;
575                                                /* check for passed illum */
576        if (passillum(m, r)) {
577                if (m->oargs.nsargs < 1 || !strcmp(m->oargs.sarg[0], VOIDID))
578                        raytrans(r);
579                else
580                        rayshade(r, modifier(m->oargs.sarg[0]));
581                return;
582        }
583                                        /* otherwise treat as source */
584                                                /* check for behind */
585        if (r->rod < 0.0)
586                return;
587                                                /* check for invisibility */
588        if (srcignore(m, r))
589                return;
590                                                /* get distribution pattern */
591        raytexture(r, m->omod);
592                                                /* get source color */
593        setcolor(r->rcol, m->oargs.farg[0],
594                          m->oargs.farg[1],
595                          m->oargs.farg[2]);
596                                                /* modify value */
597        multcolor(r->rcol, r->pcol);
517   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines