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 1.16 by greg, Fri Nov 8 16:34:24 1991 UTC vs.
Revision 2.4 by greg, Wed Feb 26 09:49:37 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 535 | Line 535 | register RAY  *r;
535   #define  distglow(m, r)         (m->otype==MAT_GLOW && \
536                                  r->rot > m->oargs.farg[3])
537  
538 < /* badambient *
538 > /* badcomponent *
539   *
540 < * We must avoid including counting light sources in the ambient calculation,
540 > * We must avoid 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 + * The same is true for stray specular samples, since the specular
544 + * contribution from light sources is calculated separately.
545   */
546  
547 < #define  badambient(m, r)       ((r->crtype&(AMBIENT|SHADOW))==AMBIENT && \
548 <                                !distglow(m, r))
547 > #define  badcomponent(m, r)     (r->crtype&(AMBIENT|SPECULAR) && \
548 >                                !(r->crtype&SHADOW || r->rod < 0.0 || \
549 >                                        distglow(m, r)))
550  
551 + /* overcount *
552 + *
553 + * All overcounting possibilities are contained here.
554 + */
555 +
556 + #define  overcount(m, r)        (badcomponent(m,r) || wrongsource(m,r))
557 +
558   /* passillum *
559   *
560   * An illum passes to another material type when we didn't hit it
# Line 570 | Line 580 | register OBJREC  *m;
580   register RAY  *r;
581   {
582                                                  /* check for over-counting */
583 <        if (wrongsource(m, r) || badambient(m, r))
583 >        if (overcount(m, r))
584                  return;
585                                                  /* check for passed illum */
586          if (passillum(m, r)) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines