volpath_simple: fixed a minor logic error that could cause errors in light paths that simultaneously involve multiple index-matched and index-mismatched medium transitions

metadata
Wenzel Jakob 2012-10-20 01:42:50 -04:00
parent f041cd58eb
commit 8e2bfb7340
1 changed files with 23 additions and 20 deletions

View File

@ -223,8 +223,12 @@ public:
if ((rRec.depth < m_maxDepth || m_maxDepth < 0) && if ((rRec.depth < m_maxDepth || m_maxDepth < 0) &&
(rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance) && (rRec.type & RadianceQueryRecord::EDirectSurfaceRadiance) &&
(bRec.sampledType & BSDF::EDelta) && (bRec.sampledType & BSDF::EDelta) &&
!((bRec.sampledType & BSDF::ENull) && scattered)) !((bRec.sampledType & BSDF::ENull) && scattered)) {
recursiveType |= RadianceQueryRecord::EEmittedRadiance; recursiveType |= RadianceQueryRecord::EEmittedRadiance;
scattered = false;
} else {
scattered |= bRec.sampledType != BSDF::ENull;
}
/* Potentially stop the recursion if there is nothing more to do */ /* Potentially stop the recursion if there is nothing more to do */
if (recursiveType == 0) if (recursiveType == 0)
@ -247,7 +251,6 @@ public:
/* In the next iteration, trace a ray in this direction */ /* In the next iteration, trace a ray in this direction */
ray = Ray(its.p, wo, ray.time); ray = Ray(its.p, wo, ray.time);
scene->rayIntersect(ray, its); scene->rayIntersect(ray, its);
scattered |= bRec.sampledType != BSDF::ENull;
} }
if (rRec.depth++ >= m_rrDepth) { if (rRec.depth++ >= m_rrDepth) {