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 1.6 by greg, Wed Jun 7 10:29:05 1989 UTC vs.
Revision 1.7 by greg, Wed Jun 7 15:07:31 1989 UTC

# Line 335 | Line 335 | char  *p;                      /* data for f */
335          }
336                                                  /* sort contributions */
337          qsort(srccnt, nsources, sizeof(CONTRIB), cntcmp);
338 <        hit2 = test2 = 0.0;
338 >        hit2 = 0.0; test2 = FTINY;
339                                                  /* test for shadows */
340          for (sn = 0; sn < nsources; sn++) {
341                                                  /* check threshold */
# Line 366 | Line 366 | char  *p;                      /* data for f */
366                  hit2 += hwt;
367                  source[srccnt[sn].sno].nhits++;
368          }
369 <        if (test2 > FTINY)              /* weighted hit rate */
370 <                hwt = hit2 / test2;
371 <        else
372 <                hwt = 0.0;
369 >                                        /* weighted hit rate */
370 >        hwt = hit2 / test2;
371   #ifdef DEBUG
372 <        fprintf(stderr, "%d tested, %f hit rate\n", sn, hwt);
372 >        {
373 >                int  ntested = sn;
374   #endif
375                                          /* add in untested sources */
376          for ( ; sn < nsources; sn++) {
# Line 382 | Line 381 | char  *p;                      /* data for f */
381                  scalecolor(srccnt[sn].val, dtmp);
382                  addcolor(r->rcol, srccnt[sn].val);
383          }
384 + #ifdef DEBUG
385 +        fprintf(stderr, "%d tested, %d untested, %f hit rate\n",
386 +                        ntested, sn-ntested, hwt);
387 +        }
388 + #endif
389                  
390          free(srccnt);
391   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines