Skip to content

Commit

Permalink
Merge pull request #441 from paulgrassler/master
Browse files Browse the repository at this point in the history
Fixing Time Sampling/Motion Blur for SPPM
  • Loading branch information
mmp authored Oct 27, 2024
2 parents f9a38ba + a04daa3 commit 1ae72cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pbrt/cpu/integrators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2867,6 +2867,8 @@ void SPPMIntegrator::Render() {
Options->disableWavelengthJitter ? Float(0.5) : RadicalInverse(1, iter);
const SampledWavelengths passLambda = film.SampleWavelengths(uLambda);

Float timeSample = RadicalInverse(2, iter);

ParallelFor2D(pixelBounds, [&](Bounds2i tileBounds) {
// Follow camera paths for _tileBounds_ in image for SPPM
ScratchBuffer &scratchBuffer = threadScratchBuffers.Get();
Expand All @@ -2876,6 +2878,7 @@ void SPPMIntegrator::Render() {
// Generate camera ray for pixel for SPPM
SampledWavelengths lambda = passLambda;
CameraSample cs = GetCameraSample(sampler, pPixel, film.GetFilter());
cs.time = timeSample;
pstd::optional<CameraRayDifferential> crd =
camera.GenerateRayDifferential(cs, lambda);
if (!crd || !crd->weight)
Expand Down Expand Up @@ -3094,7 +3097,7 @@ void SPPMIntegrator::Render() {
// Compute sample values for photon ray leaving light source
Point2f uLight0 = Sample2D();
Point2f uLight1 = Sample2D();
Float uLightTime = camera.SampleTime(Sample1D());
Float uLightTime = camera.SampleTime(timeSample);

// Generate _photonRay_ from light source and initialize _beta_
SampledWavelengths lambda = passLambda;
Expand Down

0 comments on commit 1ae72cf

Please sign in to comment.