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

Comparing ray/src/rt/pmapdata.c (file contents):
Revision 2.8 by rschregle, Tue May 26 13:31:19 2015 UTC vs.
Revision 2.10 by rschregle, Wed Jul 29 18:54:20 2015 UTC

# Line 337 | Line 337 | void findPhotons (PhotonMap* pmap, const RAY* ray)
337        pmap -> minError = FHUGE;
338        pmap -> maxError = -FHUGE;
339        pmap -> rmsError = 0;
340 <      /* Maximum search radius limit is based on avg photon distance to
340 >      /* SQUARED max search radius limit is based on avg photon distance to
341         * centre of gravity, unless fixed by user (maxDistFix > 0) */
342        pmap -> maxDist0 = pmap -> maxDistLimit =
343 <         maxDistFix > 0 ? maxDistFix
343 >         maxDistFix > 0 ? maxDistFix * maxDistFix
344                          : PMAP_MAXDIST_COEFF * pmap -> squeueSize *
345                            pmap -> CoGdist / pmap -> heapSize;
346     }
# Line 362 | Line 362 | void findPhotons (PhotonMap* pmap, const RAY* ray)
362           nearestNeighbours(pmap, pos, norm, 1);
363        }
364  
365 +      if (pmap -> maxDist < FTINY) {
366 +         sprintf(errmsg, "itsy bitsy teeny weeny photon search radius %e",
367 +                 sqrt(pmap -> maxDist));
368 +         error(WARNING, errmsg);
369 +      }
370 +
371        if (pmap -> squeueEnd < pmap -> squeueSize * pmap -> gatherTolerance) {
372           /* Short lookup; too few photons found */
373           if (pmap -> squeueEnd > PMAP_SHORT_LOOKUP_THRESH) {
# Line 392 | Line 398 | void findPhotons (PhotonMap* pmap, const RAY* ray)
398                 sprintf(errmsg,
399                         redo ? "restarting photon lookup with max radius %.1e"
400                              : "max photon lookup radius adjusted to %.1e",
401 <                       pmap -> maxDist0);
401 >                       sqrt(pmap -> maxDist0));
402                 error(WARNING, errmsg);
403   #endif
404              }
405   #ifdef PMAP_LOOKUP_REDO
406              else {
407                 sprintf(errmsg, "max photon lookup radius clamped to %.1e",
408 <                       pmap -> maxDist0);
408 >                       sqrt(pmap -> maxDist0));
409                 error(WARNING, errmsg);
410              }
411   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines