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

Comparing ray/src/rt/pmapmat.h (file contents):
Revision 2.4 by greg, Thu May 21 15:28:24 2015 UTC vs.
Revision 2.11 by rschregle, Wed Oct 28 12:32:53 2015 UTC

# Line 1 | Line 1
1 + /* RCSid $Id$ */
2   /*
3     ==================================================================
4     Photon map support routines for scattering by materials.
# Line 8 | Line 9
9     supported by the Swiss National Science Foundation (SNSF, #147053)
10     ==================================================================
11    
11   $Id$
12   */
13  
14  
# Line 17 | Line 17
17  
18     #include "pmap.h"
19  
20 <   /*
21 <      Checks for paths already accounted for in photon map to avoid
20 >  /*
21 >    ambRayInPmap():      Check for DIFFUSE -> (DIFFUSE|SPECULAR) -> *    
22 >                            subpaths.  These occur during the backward pass      
23 >                            when an ambient ray spawns an indirect diffuse or    
24 >                            specular ray.  These subpaths are already    
25 >                            accounted for in the global photon map.
26 >   */
27 >   #define ambRayInPmap(r)    ((r) -> crtype & AMBIENT && photonMapping && \
28 >                                 (ambounce < 0 || (r) -> rlvl > 1 || \
29 >                                  causticPhotonMapping || \
30 >                                  contribPhotonMapping))
31 >
32 >  /*
33 >      Check for paths already accounted for in photon map to avoid
34        double-counting during backward raytracing.
35      
24      ambRayInPmap():      Check for DIFFUSE -> (DIFFUSE|SPECULAR) -> *
25                           subpaths.  These occur during the backward pass
26                           when an ambient ray spawns an indirect diffuse or
27                           specular ray.  These subpaths are already
28                           accounted for in the global photon map.
29      
36        shadowRayInPmap():   Check for DIFFUSE -> SPECULAR -> LIGHT
37                             subpaths. These occur during the backward pass
38                             when a shadow ray is transferred through a
# Line 34 | Line 40
40                             accounted for by caustic photons in the global,
41                             contrib, or dedicated caustic photon map.
42     */
37   /*
38   #define ambRayInPmap(r)    ((r) -> crtype & AMBIENT && \
39                               ((photonMapping && \
40                                 (ambounce < 0 || (r) -> rlvl > 1)) || \
41                                 causticPhotonMapping || contribPhotonMapping))
42   */
43   #define ambRayInPmap(r)    0
43     #define shadowRayInPmap(r) ((r) -> crtype & SHADOW && \
44 <                                (ambounce < 0 || causticPhotonMapping))
45 <  
44 >                                 (ambounce < 0 || \
45 >                                    ((r) -> crtype & AMBIENT \
46 >                                       ? photonMapping \
47 >                                       : causticPhotonMapping || \
48 >                                         contribPhotonMapping)))
49 >
50     /* Check if scattered ray spawns a caustic photon */
51     #define PMAP_CAUSTICRAY(r) ((r) -> rtype & SPECULAR)
52  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines