--- ray/src/rt/pmapmat.h 2015/02/24 19:39:27 2.1 +++ ray/src/rt/pmapmat.h 2015/07/29 18:54:20 2.7 @@ -4,10 +4,11 @@ Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) (c) Fraunhofer Institute for Solar Energy Systems, - Lucerne University of Applied Sciences & Arts + (c) Lucerne University of Applied Sciences and Arts, + supported by the Swiss National Science Foundation (SNSF, #147053) ================================================================== - $Id: pmapmat.h,v 2.1 2015/02/24 19:39:27 greg Exp $ + $Id: pmapmat.h,v 2.7 2015/07/29 18:54:20 rschregle Exp $ */ @@ -17,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 @@ -33,12 +28,16 @@ accounted for by caustic photons in the global, contrib, or dedicated caustic photon map. */ - #define ambRayInPmap(r) ((r) -> crtype & AMBIENT && photonMapping) - +/* + #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) || \ - (causticPhotonMapping || \ - contribPhotonMapping))) + (ambounce < 0 || ((r) -> crtype & AMBIENT ? \ + photonMapping : causticPhotonMapping))) /* Check if scattered ray spawns a caustic photon */ #define PMAP_CAUSTICRAY(r) ((r) -> rtype & SPECULAR)