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

Comparing ray/src/rt/pmapooc.c (file contents):
Revision 1.2 by rschregle, Mon Aug 14 21:12:10 2017 UTC vs.
Revision 1.3 by rschregle, Wed Jan 24 19:39:05 2018 UTC

# Line 214 | Line 214 | int OOC_FilterPhoton (void *p, void *fd)
214         DOT(filtData->norm, photon->norm) <= PMAP_NORM_TOL * 127 * frandom())
215        return 0;
216        
217 <   if (isContribPmap(pmap) && pmap -> srcContrib) {
218 <      /* Lookup in contribution photon map */
219 <      OBJREC *srcMod;
220 <      const int srcIdx = photonSrcIdx(pmap, photon);
217 >   if (isContribPmap(pmap)) {
218 >      /* Lookup in contribution photon map; filter according to emitting
219 >       * light source if contrib list set, else accept all */
220 >      
221 >      if (pmap -> srcContrib) {
222 >         OBJREC *srcMod;
223 >         const int srcIdx = photonSrcIdx(pmap, photon);
224        
225 <      if (srcIdx < 0 || srcIdx >= nsources)
226 <         error(INTERNAL, "invalid light source index in photon map");
225 >         if (srcIdx < 0 || srcIdx >= nsources)
226 >            error(INTERNAL, "invalid light source index in photon map");
227        
228 <      srcMod = findmaterial(source [srcIdx].so);
228 >         srcMod = findmaterial(source [srcIdx].so);
229  
230 <      /* Reject photon if contributions from light source which emitted it
231 <       * are not sought */
232 <      if (!lu_find(pmap -> srcContrib, srcMod -> oname) -> data)
233 <         return 0;
230 >         /* Reject photon if contributions from light source which emitted
231 >          * it are not sought */
232 >         if (!lu_find(pmap -> srcContrib, srcMod -> oname) -> data)
233 >            return 0;
234 >      }
235  
236        /* Reject non-caustic photon if lookup for caustic contribs */
237        if (pmap -> lookupCaustic && !photon -> caustic)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines