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.72 by greg, Mon Apr 6 21:09:07 2020 UTC vs.
Revision 2.74 by greg, Thu Dec 17 03:30:37 2020 UTC

# Line 434 | Line 434 | direct(                                        /* add direct component */
434                  cntord[sn].sndx = sn;
435                  scp = srccnt + sn;
436                  scp->sno = sr.rsrc;
437 <                                                /* compute coefficient */
438 <                (*f)(scp->coef, p, sr.rdir, si.dom);
439 <                cntord[sn].brt = intens(scp->coef);
440 <                if (cntord[sn].brt <= 0.0)
441 <                        continue;
442 < #if SHADCACHE
443 <                                                /* check shadow cache */
437 > #if SHADCACHE                                   /* check shadow cache */
438                  if (si.np == 1 && srcblocked(&sr)) {
439                          cntord[sn].brt = 0.0;
440                          continue;
441                  }
442   #endif
443 +                                                /* compute coefficient */
444 +                (*f)(scp->coef, p, sr.rdir, si.dom);
445 +                cntord[sn].brt = intens(scp->coef);
446 +                if (cntord[sn].brt <= 0.0)
447 +                        continue;
448                  VCOPY(scp->dir, sr.rdir);
449                  copycolor(sr.rcoef, scp->coef);
450                                                  /* compute potential */
# Line 478 | Line 477 | direct(                                        /* add direct component */
477                                                  /* compute number to check */
478          nshadcheck = pow((double)ncnts, shadcert) + .5;
479                                                  /* modify threshold */
480 <        if (ncnts > MINSHADCNT)
482 <                ourthresh = shadthresh / r->rweight;
483 <        else
484 <                ourthresh = 0;
480 >        ourthresh = shadthresh / r->rweight;
481                                                  /* test for shadows */
482          for (nhits = 0, hwt = 0.0, sn = 0; sn < ncnts;
483                          hwt += (double)source[scp->sno].nhits /
484                                  (double)source[scp->sno].ntests,
485                          sn++) {
486                                                  /* check threshold */
487 <                if ((sn+nshadcheck>=ncnts ? cntord[sn].brt :
487 >                if (sn >= MINSHADCNT &&
488 >                            (sn+nshadcheck>=ncnts ? cntord[sn].brt :
489                                  cntord[sn].brt-cntord[sn+nshadcheck].brt)
490 <                                < ourthresh*bright(r->rcol))
490 >                                        < ourthresh*bright(r->rcol))
491                          break;
492                  scp = srccnt + cntord[sn].sndx;
493                                                  /* test for hit */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines