diff --git a/src/integrators/path/volpath.cpp b/src/integrators/path/volpath.cpp index ec85df18..690e8012 100644 --- a/src/integrators/path/volpath.cpp +++ b/src/integrators/path/volpath.cpp @@ -378,14 +378,16 @@ public: while (true) { surface = scene->rayIntersect(ray, *its); - if (surface && (interactions == maxInteractions || - !(its->getBSDF()->getType() & BSDF::ENull))) - /* Encountered an occluder -- zero transmittance. */ - break; - if (medium) transmittance *= medium->evalTransmittance(Ray(ray, 0, its->t), sampler); + if (surface && (interactions == maxInteractions || + !(its->getBSDF()->getType() & BSDF::ENull) || + its->isEmitter())) { + /* Encountered an occluder / light source */ + break; + } + if (!surface) break; diff --git a/src/librender/shape.cpp b/src/librender/shape.cpp index 6d173a4a..9e8865f8 100644 --- a/src/librender/shape.cpp +++ b/src/librender/shape.cpp @@ -156,13 +156,13 @@ void Shape::addChild(const std::string &name, ConfigurableObject *child) { m_subsurface = static_cast(child); } else if (cClass->derivesFrom(MTS_CLASS(Medium))) { if (name == "interior") { - Assert(m_interiorMedium == NULL); + Assert(m_interiorMedium == NULL || m_interiorMedium == child); if (m_subsurface != NULL) Log(EError, "Shape \"%s\" has both an interior medium " "and a subsurface scattering model -- please choose one or the other!", getName().c_str()); m_interiorMedium = static_cast(child); } else if (name == "exterior") { - Assert(m_exteriorMedium == NULL); + Assert(m_exteriorMedium == NULL || m_exteriorMedium == child); m_exteriorMedium = static_cast(child); if (m_emitter) m_emitter->setMedium(m_exteriorMedium);