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.49 by greg, Fri Apr 15 04:44:51 2005 UTC vs.
Revision 2.50 by greg, Tue Apr 19 01:15:07 2005 UTC

# Line 177 | Line 177 | srcray(                                /* send a ray to a source, return domega */
177      double  d;                          /* distance to source */
178      register SRCREC  *srcp;
179  
180 <    rayorigin(sr, r, SHADOW, 1.0);              /* ignore limits */
180 >    rayorigin(sr, SHADOW, r, NULL);             /* ignore limits */
181  
182      while ((d = nextssamp(sr, si)) != 0.0) {
183          sr->rsrc = si->sn;                      /* remember source */
# Line 393 | Line 393 | direct(                                        /* add direct component */
393                  }
394   #endif
395                  VCOPY(scp->dir, sr.rdir);
396 +                copycolor(sr.rcoef, scp->coef);
397                                                  /* compute potential */
398                  srcvalue(&sr);
399 +                multcolor(sr.rcol, sr.rcoef);
400                  copycolor(scp->val, sr.rcol);
399                multcolor(scp->val, scp->coef);
401                  cntord[sn].brt = bright(scp->val);
402          }
403                                                  /* sort contributions */
# Line 435 | Line 436 | direct(                                        /* add direct component */
436                          break;
437                  scp = srccnt + cntord[sn].sndx;
438                                                  /* test for hit */
439 <                rayorigin(&sr, r, SHADOW, 1.0);
439 >                rayorigin(&sr, SHADOW, r, NULL);
440                  VCOPY(sr.rdir, scp->dir);
441                  sr.rsrc = scp->sno;
442                                                  /* keep statistics */
# Line 448 | Line 449 | direct(                                        /* add direct component */
449                                  source[scp->sno].sflags & SFOLLOW )) {
450                                                  /* follow entire path */
451                          raycont(&sr);
451                        rayparticipate(&sr);
452                          if (trace != NULL)
453                                  (*trace)(&sr);  /* trace execution */
454 +                        rayparticipate(&sr);
455                          if (bright(sr.rcol) <= FTINY) {
456   #if SHADCACHE
457                                  if ((scp <= srccnt || scp[-1].sno != scp->sno)
# Line 664 | Line 665 | m_light(                               /* ray hit a light source */
665   )
666   {
667                                                  /* check for over-counting */
668 <        if (badcomponent(m, r))
668 >        if (badcomponent(m, r)) {
669 >                setcolor(r->rcoef, 0.0, 0.0, 0.0);
670                  return(1);
671 <        if (wrongsource(m, r))
671 >        }
672 >        if (wrongsource(m, r)) {
673 >                setcolor(r->rcoef, 0.0, 0.0, 0.0);
674                  return(1);
675 +        }
676                                                  /* check for passed illum */
677          if (passillum(m, r)) {
678                  if (m->oargs.nsargs && strcmp(m->oargs.sarg[0], VOIDID))
# Line 675 | Line 680 | m_light(                               /* ray hit a light source */
680                  raytrans(r);
681                  return(1);
682          }
683 +                                                /* check for invisibility */
684 +        if (srcignore(m, r)) {
685 +                setcolor(r->rcoef, 0.0, 0.0, 0.0);
686 +                return(1);
687 +        }
688                                          /* otherwise treat as source */
689                                                  /* check for behind */
690          if (r->rod < 0.0)
681                return(1);
682                                                /* check for invisibility */
683        if (srcignore(m, r))
691                  return(1);
692                                                  /* check for outside spot */
693          if (m->otype==MAT_SPOT && spotout(r, makespot(m)))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines