--- ray/src/rt/pmapmat.h 2015/05/21 13:54:59 2.3 +++ ray/src/rt/pmapmat.h 2015/07/29 18:54:20 2.7 @@ -8,7 +8,7 @@ supported by the Swiss National Science Foundation (SNSF, #147053) ================================================================== - $Id: pmapmat.h,v 2.3 2015/05/21 13:54:59 greg Exp $ + $Id: pmapmat.h,v 2.7 2015/07/29 18:54:20 rschregle Exp $ */ @@ -18,15 +18,9 @@ #include "pmap.h" /* - Checks for paths already accounted for in photon map to avoid + Check for paths already accounted for in photon map to avoid double-counting during backward raytracing. - ambRayInPmap(): Check for DIFFUSE -> (DIFFUSE|SPECULAR) -> * - subpaths. These occur during the backward pass - when an ambient ray spawns an indirect diffuse or - specular ray. These subpaths are already - accounted for in the global photon map. - shadowRayInPmap(): Check for DIFFUSE -> SPECULAR -> LIGHT subpaths. These occur during the backward pass when a shadow ray is transferred through a @@ -34,12 +28,16 @@ accounted for by caustic photons in the global, contrib, or dedicated caustic photon map. */ +/* #define ambRayInPmap(r) ((r) -> crtype & AMBIENT && \ ((photonMapping && \ (ambounce < 0 || (r) -> rlvl > 1)) || \ causticPhotonMapping || contribPhotonMapping)) +*/ + #define ambRayInPmap(r) 0 #define shadowRayInPmap(r) ((r) -> crtype & SHADOW && \ - photonMapping) + (ambounce < 0 || ((r) -> crtype & AMBIENT ? \ + photonMapping : causticPhotonMapping))) /* Check if scattered ray spawns a caustic photon */ #define PMAP_CAUSTICRAY(r) ((r) -> rtype & SPECULAR)