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.50 by greg, Tue Apr 19 01:15:07 2005 UTC vs.
Revision 2.53 by greg, Fri Oct 28 16:16:33 2005 UTC

# Line 382 | Line 382 | direct(                                        /* add direct component */
382                  scp->sno = sr.rsrc;
383                                                  /* compute coefficient */
384                  (*f)(scp->coef, p, sr.rdir, si.dom);
385 <                cntord[sn].brt = bright(scp->coef);
385 >                cntord[sn].brt = intens(scp->coef);
386                  if (cntord[sn].brt <= 0.0)
387                          continue;
388   #if SHADCACHE
# Line 395 | Line 395 | direct(                                        /* add direct component */
395                  VCOPY(scp->dir, sr.rdir);
396                  copycolor(sr.rcoef, scp->coef);
397                                                  /* compute potential */
398 <                srcvalue(&sr);
398 >                sr.revf = srcvalue;
399 >                rayvalue(&sr);
400                  multcolor(sr.rcol, sr.rcoef);
401                  copycolor(scp->val, sr.rcol);
402 <                cntord[sn].brt = bright(scp->val);
402 >                cntord[sn].brt = intens(sr.rcol);
403          }
404                                                  /* sort contributions */
405          qsort(cntord, sn, sizeof(CNTPTR), cntcmp);
# Line 437 | Line 438 | direct(                                        /* add direct component */
438                  scp = srccnt + cntord[sn].sndx;
439                                                  /* test for hit */
440                  rayorigin(&sr, SHADOW, r, NULL);
441 +                copycolor(sr.rcoef, scp->coef);
442                  VCOPY(sr.rdir, scp->dir);
443                  sr.rsrc = scp->sno;
444                                                  /* keep statistics */
# Line 461 | Line 463 | direct(                                        /* add direct component */
463   #endif
464                                  continue;       /* missed! */
465                          }
466 +                        multcolor(sr.rcol, sr.rcoef);
467                          copycolor(scp->val, sr.rcol);
468 <                        multcolor(scp->val, scp->coef);
468 >                } else if (trace != NULL &&
469 >                        (source[scp->sno].sflags & (SDISTANT|SVIRTUAL|SFOLLOW))
470 >                                                == (SDISTANT|SFOLLOW) &&
471 >                                sourcehit(&sr) && rayshade(&sr, sr.ro->omod)) {
472 >                        (*trace)(&sr);          /* trace execution */
473 >                        /* skip call to rayparticipate() & scp->val update */
474                  }
475                                                  /* add contribution if hit */
476                  addcolor(r->rcol, scp->val);
# Line 484 | Line 492 | direct(                                        /* add direct component */
492                  scp = srccnt + cntord[sn].sndx;
493                  prob = hwt * (double)source[scp->sno].nhits /
494                                  (double)source[scp->sno].ntests;
495 <                if (prob > 1.0)
496 <                        prob = 1.0;
489 <                scalecolor(scp->val, prob);
495 >                if (prob < 1.0)
496 >                        scalecolor(scp->val, prob);
497                  addcolor(r->rcol, scp->val);
498          }
499   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines