--- ray/src/rt/pmapamb.c 2015/02/24 19:39:26 2.1 +++ ray/src/rt/pmapamb.c 2015/08/18 18:45:55 2.6 @@ -1,13 +1,17 @@ +#ifndef lint +static const char RCSid[] = "$Id: pmapamb.c,v 2.6 2015/08/18 18:45:55 greg Exp $"; +#endif /* ================================================================== Photon map interface to RADIANCE ambient calculation 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.6 2015/08/18 18:45:55 greg Exp $ */ @@ -57,8 +61,9 @@ int ambPmapCaustic (COLOR aval, RAY *r, int rdepth) /* Handle precedence in case of multiple photon maps: contrib > caustic */ PhotonMap *pmap = contribPhotonMapping ? contribPmap : causticPmap; - /* Get caustic photon density estimate only at primary rays */ - if (pmap && !rdepth) { + /* Get caustic photon density estimate at primary rays or when + * filling in ambient rays that have no global photon map to use */ + if (pmap && (!rdepth || !globalPmap & !contribPmap & !preCompPmap)) { /* Temporarily factor ambient value into ray coefficient * (required for contribution photon map) */ copycolor(rcoef, r -> rcoef);