--- ray/src/rt/pmapamb.c 2015/02/24 19:39:26 2.1 +++ ray/src/rt/pmapamb.c 2015/05/27 16:23:41 2.3 @@ -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: pmapamb.c,v 2.1 2015/02/24 19:39:26 greg Exp $ + $Id: pmapamb.c,v 2.3 2015/05/27 16:23:41 greg Exp $ */ @@ -58,7 +59,8 @@ int ambPmapCaustic (COLOR aval, RAY *r, int rdepth) PhotonMap *pmap = contribPhotonMapping ? contribPmap : causticPmap; /* Get caustic photon density estimate only at primary rays */ - if (pmap && !rdepth) { + if (pmap && (!rdepth || (!globalPmap & !contribPmap & !preCompPmap + && r->crtype & AMBIENT))) { /* Temporarily factor ambient value into ray coefficient * (required for contribution photon map) */ copycolor(rcoef, r -> rcoef);