--- ray/src/rt/dielectric.c 2014/05/10 17:43:01 2.24 +++ ray/src/rt/dielectric.c 2015/05/20 13:12:06 2.26 @@ -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.26 2015/05/20 13:12:06 rschregle 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,8 +51,8 @@ static double mylog(double x); #define MINCOS 0.997 /* minimum dot product for dispersion */ - -static double +static +double mylog( /* special log for extinction coefficients */ double x ) @@ -83,6 +84,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");