Skip to content

Commit

Permalink
Merge pull request mmp#361 from w3ntao/master
Browse files Browse the repository at this point in the history
fix to print out debug information when cameraRay not generated
  • Loading branch information
mmp authored Jul 5, 2023
2 parents 7e97c20 + a141805 commit 84e81ad
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/pbrt/cpu/integrators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,17 @@ void RayIntegrator::EvaluatePixelSample(Point2i pPixel, int sampleIndex, Sampler
L = SampledSpectrum(0.f);
}

if (cameraRay)
PBRT_DBG(
"%s\n",
StringPrintf("Camera sample: %s -> ray %s -> L = %s, visibleSurface %s",
cameraSample, cameraRay->ray, L,
(visibleSurface ? visibleSurface.ToString() : "(none)"))
.c_str());
else
PBRT_DBG("%s\n",
StringPrintf("Camera sample: %s -> no ray generated", cameraSample)
.c_str());
PBRT_DBG(
"%s\n",
StringPrintf("Camera sample: %s -> ray %s -> L = %s, visibleSurface %s",
cameraSample, cameraRay->ray, L,
(visibleSurface ? visibleSurface.ToString() : "(none)"))
.c_str());
} else {
PBRT_DBG("%s\n",
StringPrintf("Camera sample: %s -> no ray generated", cameraSample)
.c_str());
}

// Add camera ray's contribution to image
camera.GetFilm().AddSample(pPixel, L, lambda, &visibleSurface,
cameraSample.filterWeight);
Expand Down

0 comments on commit 84e81ad

Please sign in to comment.