--- ray/src/rt/dielectric.c 2014/05/10 17:43:01 2.24 +++ ray/src/rt/dielectric.c 2015/10/28 15:45:58 2.28 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: dielectric.c,v 2.24 2014/05/10 17:43:01 greg Exp $"; +static const char RCSid[] = "$Id: dielectric.c,v 2.28 2015/10/28 15:45:58 greg Exp $"; #endif /* * dielectric.c - shading function for transparent materials. @@ -10,6 +10,7 @@ static const char RCSid[] = "$Id: dielectric.c,v 2.24 #include "ray.h" #include "otypes.h" #include "rtotypes.h" +#include "pmapmat.h" #ifdef DISPERSE #include "source.h" @@ -50,7 +51,6 @@ static double mylog(double x); #define MINCOS 0.997 /* minimum dot product for dispersion */ - static double mylog( /* special log for extinction coefficients */ double x @@ -83,6 +83,11 @@ m_dielectric( /* color a ray which hit a dielectric in RAY p; int i; + /* PMAP: skip refracted shadow or ambient ray if accounted for in + photon map */ + if (shadowRayInPmap(r) || ambRayInPmap(r)) + return(1); + if (m->oargs.nfargs != (m->otype==MAT_DIELECTRIC ? 5 : 8)) objerror(m, USER, "bad arguments");