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.73 by greg, Fri Jul 3 00:42:20 2020 UTC vs.
Revision 2.75 by greg, Mon Jan 4 19:07:15 2021 UTC

# Line 364 | Line 364 | sourcehit(                     /* check to see if ray hit distant source
364                          return(0);      /* nothing usable */
365          }
366          /*
367 <         * Make assignments.
367 >         * Assign object index
368           */
369          r->robj = objndx(r->ro);
370        for (i = 0; i < 3; i++)
371                r->ron[i] = -r->rdir[i];
372        r->rod = 1.0;
373        r->pert[0] = r->pert[1] = r->pert[2] = 0.0;
374        r->uv[0] = r->uv[1] = 0.0;
375        r->rox = NULL;
370          return(1);
371   }
372  
# Line 477 | Line 471 | direct(                                        /* add direct component */
471                                                  /* compute number to check */
472          nshadcheck = pow((double)ncnts, shadcert) + .5;
473                                                  /* modify threshold */
474 <        if (ncnts > MINSHADCNT)
481 <                ourthresh = shadthresh / r->rweight;
482 <        else
483 <                ourthresh = 0;
474 >        ourthresh = shadthresh / r->rweight;
475                                                  /* test for shadows */
476          for (nhits = 0, hwt = 0.0, sn = 0; sn < ncnts;
477                          hwt += (double)source[scp->sno].nhits /
478                                  (double)source[scp->sno].ntests,
479                          sn++) {
480                                                  /* check threshold */
481 <                if ((sn+nshadcheck>=ncnts ? cntord[sn].brt :
481 >                if (sn >= MINSHADCNT &&
482 >                            (sn+nshadcheck>=ncnts ? cntord[sn].brt :
483                                  cntord[sn].brt-cntord[sn+nshadcheck].brt)
484 <                                < ourthresh*bright(r->rcol))
484 >                                        < ourthresh*bright(r->rcol))
485                          break;
486                  scp = srccnt + cntord[sn].sndx;
487                                                  /* test for hit */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines