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.1 by rschregle, Wed May 18 08:22:45 2016 UTC vs.
Revision 1.3 by rschregle, Wed Jan 24 19:39:05 2018 UTC

# Line 1 | Line 1
1   /*
2 <   ==================================================================
2 >   ======================================================================
3     Photon map interface to out-of-core octree
4  
5     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
6     (c) Lucerne University of Applied Sciences and Arts,
7 <   supported by the Swiss National Science Foundation (SNSF, #147053)
8 <   ==================================================================
7 >       supported by the Swiss National Science Foundation (SNSF, #147053)
8 >   ======================================================================
9    
10     $Id$
11   */
12  
13  
14 < #ifndef PMAP_OOC
15 <   /* Checked in pmapdata.h */
16 <   #define PMAP_OOC
17 < #endif
14 >
15   #include "pmapdata.h"   /* Includes pmapooc.h */
16   #include "source.h"
17   #include "oocsort.h"
# Line 217 | 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