mirror of
https://github.com/mmp/pbrt-v4
synced 2026-09-26 16:20:07 +03:00
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:
parent
dbd005ac52
commit
cdccb71cb1
1 changed files with 2 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue