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.47 by greg, Thu Mar 10 22:37:00 2005 UTC vs.
Revision 2.50 by greg, Tue Apr 19 01:15:07 2005 UTC

# Line 46 | Line 46 | extern OBJREC *                        /* find an object's actual material
46   findmaterial(register OBJREC *o)
47   {
48          while (!ismaterial(o->otype)) {
49                if (ismixture(o->otype))
50                        return(NULL);   /* reject mixed materials */
49                  if (o->otype == MOD_ALIAS && o->oargs.nsargs) {
50                          OBJECT  aobj;
51                          OBJREC  *ao;
# Line 62 | Line 60 | findmaterial(register OBJREC *o)
60                          return(NULL);
61                  o = objptr(o->omod);
62          }
63 <        return(o);
63 >        return(o);              /* mixtures will return NULL */
64   }
65  
66  
# Line 179 | 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 395 | 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 <                sr.revf = srcvalue;
399 <                rayvalue(&sr);
398 >                srcvalue(&sr);
399 >                multcolor(sr.rcol, sr.rcoef);
400                  copycolor(scp->val, sr.rcol);
402                multcolor(scp->val, scp->coef);
401                  cntord[sn].brt = bright(scp->val);
402          }
403                                                  /* sort contributions */
# Line 438 | 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 451 | Line 449 | direct(                                        /* add direct component */
449                                  source[scp->sno].sflags & SFOLLOW )) {
450                                                  /* follow entire path */
451                          raycont(&sr);
454                        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 667 | 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 678 | 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)
684                return(1);
685                                                /* check for invisibility */
686        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