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

Comparing ray/src/rt/source.c (file contents):
Revision 2.38 by greg, Wed Dec 31 01:50:02 2003 UTC vs.
Revision 2.54 by greg, Wed Jul 12 05:47:05 2006 UTC

# Line 7 | Line 7 | static const char RCSid[] = "$Id$";
7   *  External symbols declared in source.h
8   */
9  
10 #include "copyright.h"
11
10   #include  "ray.h"
13
11   #include  "otypes.h"
12 <
16 < #include  "otspecial.h"
17 <
12 > #include  "rtotypes.h"
13   #include  "source.h"
19
14   #include  "random.h"
15  
16   extern double  ssampdist;               /* scatter sampling distance */
# Line 45 | Line 39 | static CONTRIB  *srccnt;               /* source contributions in d
39   static CNTPTR  *cntord;                 /* source ordering in direct() */
40   static int  maxcntr = 0;                /* size of contribution arrays */
41  
42 + static int cntcmp(const void *p1, const void *p2);
43  
44 < OBJREC *                        /* find an object's actual material */
44 >
45 > extern OBJREC *                 /* find an object's actual material */
46   findmaterial(register OBJREC *o)
47   {
48          while (!ismaterial(o->otype)) {
53                if (ismixture(o->otype))
54                        return(NULL);   /* reject mixed materials */
49                  if (o->otype == MOD_ALIAS && o->oargs.nsargs) {
50                          OBJECT  aobj;
51                          OBJREC  *ao;
# Line 61 | Line 55 | findmaterial(register OBJREC *o)
55                          ao = objptr(aobj);
56                          if (ismaterial(ao->otype))
57                                  return(ao);
58 +                        if (ao->otype == MOD_ALIAS) {
59 +                                o = ao;
60 +                                continue;
61 +                        }
62                  }
63                  if (o->omod == OVOID)
64                          return(NULL);
65                  o = objptr(o->omod);
66          }
67 <        return(o);
67 >        return(o);              /* mixtures will return NULL */
68   }
69  
70  
71 < void
72 < marksources()                   /* find and mark source objects */
71 > extern void
72 > marksources(void)                       /* find and mark source objects */
73   {
74          int  foundsource = 0;
75          int  i;
# Line 87 | Line 85 | marksources()                  /* find and mark source objects */
85                  if (!issurface(o->otype) || o->omod == OVOID)
86                          continue;
87                                          /* find material */
88 <                m = findmaterial(o);
88 >                m = findmaterial(objptr(o->omod));
89                  if (m == NULL || !islight(m->otype))
90                          continue;       /* not source modifier */
91          
# Line 129 | Line 127 | marksources()                  /* find and mark source objects */
127                          }
128                  }
129   #if  SHADCACHE
130 <                source[ns].obscache = NULL;
130 >                initobscache(ns);
131   #endif
132                  if (!(source[ns].sflags & SSKIP))
133                          foundsource++;
# Line 151 | Line 149 | memerr:
149   }
150  
151  
152 < void
153 < freesources()                   /* free all source structures */
152 > extern void
153 > freesources(void)                       /* free all source structures */
154   {
155          if (nsources > 0) {
156   #if SHADCACHE
# Line 173 | Line 171 | freesources()                  /* free all source structures */
171   }
172  
173  
174 < int
174 > extern int
175   srcray(                         /* send a ray to a source, return domega */
176 < register RAY  *sr,              /* returned source ray */
177 < RAY  *r,                        /* ray which hit object */
178 < SRCINDEX  *si                   /* source sample index */
176 >        register RAY  *sr,              /* returned source ray */
177 >        RAY  *r,                        /* ray which hit object */
178 >        SRCINDEX  *si                   /* source sample index */
179   )
180   {
181      double  d;                          /* distance to source */
182      register SRCREC  *srcp;
183  
184 <    rayorigin(sr, r, SHADOW, 1.0);              /* ignore limits */
184 >    rayorigin(sr, SHADOW, r, NULL);             /* ignore limits */
185  
186      while ((d = nextssamp(sr, si)) != 0.0) {
187          sr->rsrc = si->sn;                      /* remember source */
# Line 212 | Line 210 | SRCINDEX  *si                  /* source sample index */
210   }
211  
212  
213 < void
213 > extern void
214   srcvalue(                       /* punch ray to source and compute value */
215 < register RAY  *r
215 >        register RAY  *r
216   )
217   {
218          register SRCREC  *sp;
# Line 254 | Line 252 | nomat:
252   }
253  
254  
255 < int
255 > static int
256 > transillum(                     /* check if material is transparent illum */
257 >        OBJECT  obj
258 > )
259 > {
260 >        OBJREC *m = findmaterial(objptr(obj));
261 >        
262 >        if (m == NULL)
263 >                return(1);
264 >        if (m->otype != MAT_ILLUM)
265 >                return(0);
266 >        return(!m->oargs.nsargs || !strcmp(m->oargs.sarg[0], VOIDID));
267 > }
268 >
269 >
270 > extern int
271   sourcehit(                      /* check to see if ray hit distant source */
272 < register RAY  *r
272 >        register RAY  *r
273   )
274   {
275 +        int  glowsrc = -1;
276 +        int  transrc = -1;
277          int  first, last;
278          register int  i;
279  
# Line 267 | Line 282 | register RAY  *r
282          } else {                        /* otherwise check all */
283                  first = 0; last = nsources-1;
284          }
285 <        for (i = first; i <= last; i++)
286 <                if ((source[i].sflags & (SDISTANT|SVIRTUAL)) == SDISTANT)
287 <                        /*
288 <                         * Check to see if ray is within
289 <                         * solid angle of source.
290 <                         */
291 <                        if (2.0*PI * (1.0 - DOT(source[i].sloc,r->rdir))
292 <                                        <= source[i].ss2) {
293 <                                r->ro = source[i].so;
294 <                                if (!(source[i].sflags & SSKIP))
295 <                                        break;
296 <                        }
297 <
298 <        if (r->ro != NULL) {
299 <                r->robj = objndx(r->ro);
300 <                for (i = 0; i < 3; i++)
301 <                        r->ron[i] = -r->rdir[i];
302 <                r->rod = 1.0;
303 <                r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
304 <                r->uv[0] = r->uv[1] = 0.0;
305 <                r->rox = NULL;
306 <                return(1);
285 >        for (i = first; i <= last; i++) {
286 >                if ((source[i].sflags & (SDISTANT|SVIRTUAL)) != SDISTANT)
287 >                        continue;
288 >                /*
289 >                 * Check to see if ray is within
290 >                 * solid angle of source.
291 >                 */
292 >                if (2.*PI*(1. - DOT(source[i].sloc,r->rdir)) > source[i].ss2)
293 >                        continue;
294 >                                        /* is it the only possibility? */
295 >                if (first == last) {
296 >                        r->ro = source[i].so;
297 >                        break;
298 >                }
299 >                /*
300 >                 * If it's a glow or transparent illum, just remember it.
301 >                 */
302 >                if (source[i].sflags & SSKIP) {
303 >                        glowsrc = i;
304 >                        continue;
305 >                }
306 >                if (transillum(source[i].so->omod)) {
307 >                        transrc = i;
308 >                        continue;
309 >                }
310 >                r->ro = source[i].so;   /* otherwise, use first hit */
311 >                break;
312          }
313 <        return(0);
314 < }
315 <
316 <
317 < #if  SHADCACHE                  /* preemptive shadow checking */
318 < #define ABS(x)  ((x)>0 ? (x) : -(x))
319 <
320 < static void                             /* find closest blockers to source */
321 < initobscache(SRCREC *srcp)
322 < {
303 <        int     i;
304 <        int     cachelen;
305 <
306 <        if (srcp->sflags & SDISTANT)
307 <                cachelen = 4*SHADCACHE*SHADCACHE;
308 <        else if (srcp->sflags & SFLAT)
309 <                cachelen = SHADCACHE*SHADCACHE*3 + (SHADCACHE&1)*SHADCACHE*4;
310 <        else /* spherical distribution */
311 <                cachelen = SHADCACHE*SHADCACHE*6;
312 <                                        /* allocate cache */
313 <        DCHECK(srcp->obscache != NULL,
314 <                        CONSISTENCY, "initobscache() called twice");
315 <        srcp->obscache = (OBSCACHE *)malloc(sizeof(OBSCACHE) +
316 <                                                sizeof(OBJECT)*(cachelen-1));
317 <        if (srcp->obscache == NULL)
318 <                error(SYSTEM, "out of memory in initobscache()");
319 <                                        /* set parameters */
320 <        if (srcp->sflags & SDISTANT) {
321 <                int     ax, ax1, ax2;
322 <                RREAL   amax = 0;
323 <                for (ax1 = 3; ax1--; )
324 <                        if (ABS(srcp->sloc[ax1]) > amax) {
325 <                                amax = ABS(srcp->sloc[ax1]);
326 <                                ax = ax1;
327 <                        }
328 <                srcp->obscache->p.d.ax = ax;
329 <                ax1 = (ax+1)%3;
330 <                ax2 = (ax+2)%3;
331 <                VCOPY(srcp->obscache->p.d.o, thescene.cuorg);
332 <                if (srcp->sloc[ax] > 0)
333 <                        srcp->obscache->p.d.o[ax] += thescene.cusize;
334 <                if (srcp->sloc[ax1] < 0)
335 <                        srcp->obscache->p.d.o[ax1] += thescene.cusize *
336 <                                        srcp->sloc[ax1] / ABS(srcp->sloc[ax]);
337 <                if (srcp->sloc[ax2] < 0)
338 <                        srcp->obscache->p.d.o[ax2] += thescene.cusize *
339 <                                        srcp->sloc[ax2] / ABS(srcp->sloc[ax]);
340 <                srcp->obscache->p.d.e1 = (1.-FTINY) / (thescene.cusize*(1. +
341 <                                fabs(srcp->sloc[ax1]/srcp->sloc[ax])));
342 <                srcp->obscache->p.d.e2 = (1.-FTINY) / (thescene.cusize*(1. +
343 <                                fabs(srcp->sloc[ax2]/srcp->sloc[ax])));
344 <        } else if (srcp->sflags & SFLAT) {
345 <                VCOPY(srcp->obscache->p.f.u, srcp->ss[SU]);
346 <                normalize(srcp->obscache->p.f.u);
347 <                fcross(srcp->obscache->p.f.v,
348 <                                srcp->snorm, srcp->obscache->p.f.u);
313 >        /*
314 >         * Do we need fallback?
315 >         */
316 >        if (r->ro == NULL) {
317 >                if (transrc >= 0 && r->crtype & (AMBIENT|SPECULAR))
318 >                        return(0);      /* avoid overcounting */
319 >                if (glowsrc >= 0)
320 >                        r->ro = source[glowsrc].so;
321 >                else
322 >                        return(0);      /* nothing usable */
323          }
324 <                                        /* XXX Should cast rays from source */
325 <        for (i = cachelen; i--; )
326 <                srcp->obscache->obs[i] = OVOID;
324 >        /*
325 >         * Make assignments.
326 >         */
327 >        r->robj = objndx(r->ro);
328 >        for (i = 0; i < 3; i++)
329 >                r->ron[i] = -r->rdir[i];
330 >        r->rod = 1.0;
331 >        r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
332 >        r->uv[0] = r->uv[1] = 0.0;
333 >        r->rox = NULL;
334 >        return(1);
335   }
336  
337  
356 static OBJECT *                 /* return occluder cache entry */
357 srcobstructp(register RAY *r)
358 {
359        static OBJECT   noobs;
360        SRCREC          *srcp;
361        int             ondx;
362
363        DCHECK(r->rsrc < 0, CONSISTENCY,
364                        "srcobstructp() called with unaimed ray");
365        noobs = OVOID;
366        srcp = &source[r->rsrc];
367        if (srcp->obscache == NULL)     /* initialize cache */
368                initobscache(srcp);
369                                        /* compute cache index */
370        if (srcp->sflags & SDISTANT) {
371                int     ax, ax1, ax2;
372                double  t;
373                ax = srcp->obscache->p.d.ax;
374                if ((ax1 = ax+1) >= 3) ax1 -= 3;
375                if ((ax2 = ax+2) >= 3) ax2 -= 3;
376                t = (srcp->obscache->p.d.o[ax] - r->rorg[ax]) / srcp->sloc[ax];
377                if (t <= FTINY)
378                        return &noobs;  /* could happen if ray is outside */
379                ondx = 2*SHADCACHE*(int)(2*SHADCACHE*srcp->obscache->p.d.e1 *
380                                (r->rorg[ax1] + t*srcp->sloc[ax1] -
381                                        srcp->obscache->p.d.o[ax1]));
382                ondx += (int)(2*SHADCACHE*srcp->obscache->p.d.e2 *
383                                (r->rorg[ax2] + t*srcp->sloc[ax2] -
384                                        srcp->obscache->p.d.o[ax2]));
385        } else if (srcp->sflags & SFLAT) {
386                FVECT   sd;
387                RREAL   sd0m, sd1m;
388                sd[0] = -DOT(r->rdir, srcp->obscache->p.f.u);
389                sd[1] = -DOT(r->rdir, srcp->obscache->p.f.v);
390                sd[2] = -DOT(r->rdir, srcp->snorm);
391                if (sd[2] < 0)
392                        return &noobs;  /* shouldn't happen */
393                sd0m = ABS(sd[0]);
394                sd1m = ABS(sd[1]);
395                if (sd[2] >= sd0m && sd[2] >= sd1m) {
396                        ondx = SHADCACHE*(int)(SHADCACHE*(.5-FTINY) *
397                                        (1. + sd[0]/sd[2]));
398                        ondx += (int)(SHADCACHE*(.5-FTINY) *
399                                        (1. + sd[1]/sd[2]));
400                } else if (sd0m >= sd1m) {
401                        ondx = SHADCACHE*SHADCACHE;
402                        if (sd[0] < 0)
403                                ondx += ((SHADCACHE+1)>>1)*SHADCACHE;
404                        ondx += SHADCACHE*(int)(SHADCACHE*(.5-FTINY) *
405                                        sd[2]/sd0m);
406                        ondx += (int)(SHADCACHE*(.5-FTINY) *
407                                        (1. + sd[1]/sd0m));
408                } else /* sd1m > sd0m */ {
409                        ondx = SHADCACHE*SHADCACHE +
410                                        ((SHADCACHE+1)>>1)*SHADCACHE*2;
411                        if (sd[1] < 0)
412                                ondx += ((SHADCACHE+1)>>1)*SHADCACHE;
413                        ondx += SHADCACHE*(int)(SHADCACHE*(.5-FTINY) *
414                                        sd[2]/sd1m);
415                        ondx += (int)(SHADCACHE*(.5-FTINY) *
416                                        (1. + sd[0]/sd1m));
417                }
418        } else /* spherical distribution */ {
419                int     ax, ax1, ax2;
420                RREAL   amax = 0;
421                for (ax1 = 3; ax1--; )
422                        if (ABS(r->rdir[ax1]) > amax) {
423                                amax = ABS(r->rdir[ax1]);
424                                ax = ax1;
425                        }
426                if ((ax1 = ax+1) >= 3) ax1 -= 3;
427                if ((ax2 = ax+2) >= 3) ax2 -= 3;
428                ondx = 2*SHADCACHE*SHADCACHE * ax;
429                if (r->rdir[ax] < 0)
430                        ondx += SHADCACHE*SHADCACHE;
431                ondx += SHADCACHE*(int)(SHADCACHE*(.5-FTINY) *
432                                        (1. + r->rdir[ax1]/amax));
433                ondx += (int)(SHADCACHE*(.5-FTINY) *
434                                (1. + r->rdir[ax2]/amax));
435        }
436                                        /* return cache pointer */
437        return(&srcp->obscache->obs[ondx]);
438 }
439
440
441 void                            /* free obstruction cache */
442 freeobscache(SRCREC *srcp)
443 {
444        if (srcp->obscache == NULL)
445                return;
446        free((void *)srcp->obscache);
447        srcp->obscache = NULL;
448 }
449
450        
451 void                            /* record a source blocker */
452 srcblocker(register RAY *r)
453 {
454        OBJREC  *m;
455
456        if (r->robj == OVOID || objptr(r->robj) != r->ro ||
457                        isvolume(r->ro->otype))
458                return;                 /* don't record complex blockers */
459        m = findmaterial(r->ro);
460        if (m == NULL)
461                return;                 /* no material?! */
462        if (!(ofun[m->otype].flags & T_OPAQUE))
463                return;                 /* material not a reliable blocker */
464
465        *srcobstructp(r) = r->robj;     /* else record obstructor */
466 }
467
468
469 int                             /* check ray against cached blocker */
470 srcblocked(RAY *r)
471 {
472        OBJECT  obs = *srcobstructp(r);
473        OBJREC  *op;
474
475        if (obs == OVOID)
476                return(0);
477        op = objptr(obs);               /* check for intersection */
478        return ((*ofun[op->otype].funp)(op, r));
479 }
480
481 #endif
482
483
338   static int
339   cntcmp(                         /* contribution compare (descending) */
340 < const void *p1,
341 < const void *p2
340 >        const void *p1,
341 >        const void *p2
342   )
343   {
344          register const CNTPTR  *sc1 = (const CNTPTR *)p1;
# Line 498 | Line 352 | const void *p2
352   }
353  
354  
355 < void
355 > extern void
356   direct(                                 /* add direct component */
357 < RAY  *r,                        /* ray that hit surface */
358 < void  (*f)(),                   /* direct component coefficient function */
359 < char  *p                        /* data for f */
357 >        RAY  *r,                        /* ray that hit surface */
358 >        srcdirf_t *f,                   /* direct component coefficient function */
359 >        void  *p                        /* data for f */
360   )
361   {
508        extern void  (*trace)();
362          register int  sn;
363          register CONTRIB  *scp;
364          SRCINDEX  si;
# Line 533 | Line 386 | char  *p                       /* data for f */
386                  scp->sno = sr.rsrc;
387                                                  /* compute coefficient */
388                  (*f)(scp->coef, p, sr.rdir, si.dom);
389 <                cntord[sn].brt = bright(scp->coef);
389 >                cntord[sn].brt = intens(scp->coef);
390                  if (cntord[sn].brt <= 0.0)
391                          continue;
392   #if SHADCACHE
# Line 544 | Line 397 | char  *p                       /* data for f */
397                  }
398   #endif
399                  VCOPY(scp->dir, sr.rdir);
400 +                copycolor(sr.rcoef, scp->coef);
401                                                  /* compute potential */
402                  sr.revf = srcvalue;
403                  rayvalue(&sr);
404 +                multcolor(sr.rcol, sr.rcoef);
405                  copycolor(scp->val, sr.rcol);
406 <                multcolor(scp->val, scp->coef);
552 <                cntord[sn].brt = bright(scp->val);
406 >                cntord[sn].brt = intens(sr.rcol);
407          }
408                                                  /* sort contributions */
409          qsort(cntord, sn, sizeof(CNTPTR), cntcmp);
# Line 587 | Line 441 | char  *p                       /* data for f */
441                          break;
442                  scp = srccnt + cntord[sn].sndx;
443                                                  /* test for hit */
444 <                rayorigin(&sr, r, SHADOW, 1.0);
444 >                rayorigin(&sr, SHADOW, r, NULL);
445 >                copycolor(sr.rcoef, scp->coef);
446                  VCOPY(sr.rdir, scp->dir);
447                  sr.rsrc = scp->sno;
448                                                  /* keep statistics */
# Line 600 | Line 455 | char  *p                       /* data for f */
455                                  source[scp->sno].sflags & SFOLLOW )) {
456                                                  /* follow entire path */
457                          raycont(&sr);
603                        rayparticipate(&sr);
458                          if (trace != NULL)
459                                  (*trace)(&sr);  /* trace execution */
460 +                        rayparticipate(&sr);
461                          if (bright(sr.rcol) <= FTINY) {
462   #if SHADCACHE
463                                  if ((scp <= srccnt || scp[-1].sno != scp->sno)
464 <                                                && (scp >= srccnt+ncnts ||
464 >                                                && (scp >= srccnt+ncnts-1 ||
465                                                      scp[1].sno != scp->sno))
466                                          srcblocker(&sr);
467   #endif
468                                  continue;       /* missed! */
469                          }
470 +                        multcolor(sr.rcol, sr.rcoef);
471                          copycolor(scp->val, sr.rcol);
472 <                        multcolor(scp->val, scp->coef);
472 >                } else if (trace != NULL &&
473 >                        (source[scp->sno].sflags & (SDISTANT|SVIRTUAL|SFOLLOW))
474 >                                                == (SDISTANT|SFOLLOW) &&
475 >                                sourcehit(&sr) && rayshade(&sr, sr.ro->omod)) {
476 >                        (*trace)(&sr);          /* trace execution */
477 >                        /* skip call to rayparticipate() & scp->val update */
478                  }
479                                                  /* add contribution if hit */
480                  addcolor(r->rcol, scp->val);
# Line 635 | Line 496 | char  *p                       /* data for f */
496                  scp = srccnt + cntord[sn].sndx;
497                  prob = hwt * (double)source[scp->sno].nhits /
498                                  (double)source[scp->sno].ntests;
499 <                if (prob > 1.0)
500 <                        prob = 1.0;
640 <                scalecolor(scp->val, prob);
499 >                if (prob < 1.0)
500 >                        scalecolor(scp->val, prob);
501                  addcolor(r->rcol, scp->val);
502          }
503   }
504  
505  
506 < void
506 > extern void
507   srcscatter(                     /* compute source scattering into ray */
508 < register RAY  *r
508 >        register RAY  *r
509   )
510   {
511          int  oldsampndx;
# Line 691 | Line 551 | register RAY  *r
551                          if (!srcray(&sr, NULL, &si) ||
552                                          sr.rsrc != r->slights[i])
553                                  continue;               /* no path */
554 + #if SHADCACHE
555 +                        if (srcblocked(&sr))            /* check shadow cache */
556 +                                continue;
557 + #endif
558                          copycolor(sr.cext, r->cext);
559                          copycolor(sr.albedo, r->albedo);
560                          sr.gecc = r->gecc;
561                          sr.slights = r->slights;
562                          rayvalue(&sr);                  /* eval. source ray */
563 <                        if (bright(sr.rcol) <= FTINY)
563 >                        if (bright(sr.rcol) <= FTINY) {
564 > #if SHADCACHE
565 >                                srcblocker(&sr);        /* add blocker to cache */
566 > #endif
567                                  continue;
568 +                        }
569                          if (r->gecc <= FTINY)           /* compute P(theta) */
570                                  d = 1.;
571                          else {
# Line 735 | Line 603 | register RAY  *r
603   */
604  
605   static int
606 < weaksrcmat(int obj)             /* identify material */
606 > weaksrcmat(OBJECT obj)          /* identify material */
607   {
608 <        register OBJREC *o = objptr(obj);
608 >        OBJREC *m = findmaterial(objptr(obj));
609          
610 <        while (!ismaterial(o->otype))   /* find material */
611 <                o = objptr(o->omod);
744 <        return((o->otype==MAT_ILLUM)|(o->otype==MAT_GLOW));
610 >        if (m == NULL) return(0);
611 >        return((m->otype==MAT_ILLUM) | (m->otype==MAT_GLOW));
612   }
613  
614   #define  illumblock(m, r)       (!(source[r->rsrc].sflags&SVIRTUAL) && \
# Line 802 | Line 669 | weaksrcmat(int obj)            /* identify material */
669                                  distglow(m, r, raydist(r,PRIMARY)))
670  
671  
672 < int
672 > extern int
673   m_light(                                /* ray hit a light source */
674 < register OBJREC  *m,
675 < register RAY  *r
674 >        register OBJREC  *m,
675 >        register RAY  *r
676   )
677   {
678                                                  /* check for over-counting */
679 <        if (badcomponent(m, r))
679 >        if (badcomponent(m, r)) {
680 >                setcolor(r->rcoef, 0.0, 0.0, 0.0);
681                  return(1);
682 <        if (wrongsource(m, r))
682 >        }
683 >        if (wrongsource(m, r)) {
684 >                setcolor(r->rcoef, 0.0, 0.0, 0.0);
685                  return(1);
686 +        }
687                                                  /* check for passed illum */
688          if (passillum(m, r)) {
689                  if (m->oargs.nsargs && strcmp(m->oargs.sarg[0], VOIDID))
# Line 820 | Line 691 | register RAY  *r
691                  raytrans(r);
692                  return(1);
693          }
694 +                                                /* check for invisibility */
695 +        if (srcignore(m, r)) {
696 +                setcolor(r->rcoef, 0.0, 0.0, 0.0);
697 +                return(1);
698 +        }
699                                          /* otherwise treat as source */
700                                                  /* check for behind */
701          if (r->rod < 0.0)
826                return(1);
827                                                /* check for invisibility */
828        if (srcignore(m, r))
702                  return(1);
703                                                  /* check for outside spot */
704          if (m->otype==MAT_SPOT && spotout(r, makespot(m)))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines