ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/eplus_adduvf.c
(Generate patch)

Comparing ray/src/util/eplus_adduvf.c (file contents):
Revision 2.3 by greg, Mon Feb 10 04:51:26 2014 UTC vs.
Revision 2.4 by greg, Mon Feb 10 17:50:02 2014 UTC

# Line 305 | Line 305 | sample_triangle(const Vert2_list *vl2, int a, int b, i
305          samp = (float *)malloc(sizeof(float)*6*ns);
306          if (samp == NULL)
307                  return(0);
308 <        for (i = ns; i--; ) {
308 >        for (i = ns; i--; ) {           /* stratified Monte Carlo sampling */
309                  double  sv[4];
310                  multisamp(sv, 4, (i+frandom())/(double)ns);
311                  sv[0] *= sv[1] = sqrt(sv[1]);
# Line 379 | Line 379 | compute_uvfs(SUBPROC *pd, ZONE *zp)
379                  return(0);
380                                                  /* UVFs from each surface */
381          for (n = zp->nsurf, pptr = zp->pfirst; n--; pptr = pptr->dnext) {
382 +                double  vfsum = 0;
383                                                  /* send samples to rcontrib */
384                  if (!sample_surface(pptr, pd->w))
385                          return(0);
# Line 392 | Line 393 | compute_uvfs(SUBPROC *pd, ZONE *zp)
393                                                  /* append UVF fields */
394                  for (m = 0, pptr1 = zp->pfirst;
395                                  m < zp->nsurf; m++, pptr1 = pptr1->dnext) {
396 +                        vfsum += uvfa[3*m + 1];
397                          if (pptr1 == pptr) {
398                                  if (uvfa[3*m + 1] > .001)
399                                          fprintf(stderr,
# Line 413 | Line 415 | compute_uvfs(SUBPROC *pd, ZONE *zp)
415                                  return(0);
416                          }
417                  }
418 +                if (vfsum < 0.95)
419 +                        fprintf(stderr,
420 +                "%s: warning - missing %.1f%% of energy from surface '%s'\n",
421 +                                        progname, 100.*(1.-vfsum),
422 +                                        idf_getfield(pptr,NAME_FLD)->val);
423          }
424          free(uvfa);                             /* clean up and return */
425          return(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines