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.13 by rschregle, Wed Sep 9 16:08:46 2015 UTC vs.
Revision 2.14 by rschregle, Thu Feb 4 11:36:59 2016 UTC

# Line 231 | Line 231 | static void nearestNeighbours (PhotonMap* pmap, const
231           nearestNeighbours(pmap, pos, norm, node << 1);
232     }
233  
234 <   /* Reject photon if normal faces away (ignored for volume photons) */
235 <   if (norm && DOT(norm, p -> norm) <= 0.5 * frandom())
234 >   /* Reject photon if normal faces away (ignored for volume photons) with
235 >    * 50% tolerance to account for perturbation; note photon normal is coded
236 >    * in range [-127,127].  */
237 >   if (norm && DOT(norm, p -> norm) <= 63.5 * frandom())
238        return;
239        
240     if (isContribPmap(pmap) && pmap -> srcContrib) {
# Line 471 | Line 473 | static void nearest1Neighbour (PhotonMap *pmap, const
473     dv [2] = pos [2] - p -> pos [2];
474     d2 = DOT(dv, dv);
475    
476 <   if (d2 < pmap -> maxDist && DOT(norm, p -> norm) > 0.5 * frandom()) {
477 <      /* Closest photon so far with similar normal */
476 >   if (d2 < pmap -> maxDist && DOT(norm, p -> norm) > 63.5 * frandom()) {
477 >      /* Closest photon so far with similar normal. We allow a 50% tolerance
478 >       * to account for perturbation in the latter; note the photon normal
479 >       * is coded in the range [-127,127].  */  
480        pmap -> maxDist = d2;
481        *photon = p;
482     }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines