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.2 by greg, Sat Jan 4 19:54:20 1992 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1991 Regents of the University of California */
1 > /* Copyright (c) 1992 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 526 | Line 526 | register RAY  *r;
526   #define  wrongsource(m, r)      (r->rsrc>=0 && source[r->rsrc].so!=r->ro && \
527                                  (m->otype!=MAT_ILLUM || wrongillum(m,r)))
528  
529 + /* badspecular *
530 + *
531 + * Any undirected specular ray that hits a light source
532 + * should be discarded.  This is because the source contribution to
533 + * specular components is calculated separately to reduce variance.
534 + */
535 +
536 + #define  badspecular(m, r)      (r->rsrc<0 && r->crtype&SPECULAR)
537 +
538   /* distglow *
539   *
540   * A distant glow is an object that sometimes acts as a light source,
# Line 545 | Line 554 | register RAY  *r;
554   #define  badambient(m, r)       ((r->crtype&(AMBIENT|SHADOW))==AMBIENT && \
555                                  !distglow(m, r))
556  
557 + /* overcount *
558 + *
559 + * All overcounting possibilities are contained here.
560 + */
561 +
562 + #define  overcount(m, r)        (badspecular(m,r) || wrongsource(m,r) || \
563 +                                badambient(m,r))
564 +
565   /* passillum *
566   *
567   * An illum passes to another material type when we didn't hit it
# Line 570 | Line 587 | register OBJREC  *m;
587   register RAY  *r;
588   {
589                                                  /* check for over-counting */
590 <        if (wrongsource(m, r) || badambient(m, r))
590 >        if (overcount(m, r))
591                  return;
592                                                  /* check for passed illum */
593          if (passillum(m, r)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines