Fix handling of interface materials in Path and SimplePath integrators

For these, if a ray goes through an interface we need to treat the interface
as specular. (This is needed since the shadow ray test used in these
integrators does not handle interfaces but just returns false for shadow
rays that hit them.) Related to #271.
This commit is contained in:
Matt Pharr 2022-05-27 16:08:52 -07:00
parent dbd005ac52
commit cdccb71cb1

View file

@ -420,6 +420,7 @@ SampledSpectrum SimplePathIntegrator::Li(RayDifferential ray, SampledWavelengths
// Get BSDF and skip over medium boundaries
BSDF bsdf = isect.GetBSDF(ray, lambda, camera, scratchBuffer, sampler);
if (!bsdf) {
specularBounce = true;
isect.SkipIntersection(&ray, si->tHit);
continue;
}
@ -677,6 +678,7 @@ SampledSpectrum PathIntegrator::Li(RayDifferential ray, SampledWavelengths &lamb
// Get BSDF and skip over medium boundaries
BSDF bsdf = isect.GetBSDF(ray, lambda, camera, scratchBuffer, sampler);
if (!bsdf) {
specularBounce = true; // disable MIS if the indirect ray hits a light
isect.SkipIntersection(&ray, si->tHit);
continue;
}