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.6 by greg, Thu May 21 13:54:59 2015 UTC vs.
Revision 2.7 by rschregle, Tue May 26 11:26:27 2015 UTC

# Line 19 | Line 19
19   #include "otypes.h"
20   #include "source.h"
21   #include "rcontrib.h"
22 + #include "random.h"
23  
24  
25  
# Line 229 | Line 230 | static void nearestNeighbours (PhotonMap* pmap, const
230     }
231  
232     /* Reject photon if normal faces away (ignored for volume photons) */
233 <   if (norm && DOT(norm, p -> norm) <= 0)
233 >   if (norm && DOT(norm, p -> norm) <= 0.5 * frandom())
234        return;
235        
236     if (isContribPmap(pmap) && pmap -> srcContrib) {
# Line 455 | Line 456 | static void nearest1Neighbour (PhotonMap *pmap, const
456     dv [2] = pos [2] - p -> pos [2];
457     d2 = DOT(dv, dv);
458    
459 <   if (d2 < pmap -> maxDist && DOT(norm, p -> norm) > 0) {
459 >   if (d2 < pmap -> maxDist && DOT(norm, p -> norm) > 0.5 * frandom()) {
460        /* Closest photon so far with similar normal */
461        pmap -> maxDist = d2;
462        *photon = p;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines