From a1553d9ca10c2b1efce190a27411dd07a5807c9a Mon Sep 17 00:00:00 2001 From: paulgrassler <63547551+paulgrassler@users.noreply.github.com> Date: Sat, 21 Sep 2024 10:45:00 +0200 Subject: [PATCH 1/2] fix SPPM time sampling --- src/pbrt/cpu/integrators.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pbrt/cpu/integrators.cpp b/src/pbrt/cpu/integrators.cpp index ff6c74f08..7a3c18811 100644 --- a/src/pbrt/cpu/integrators.cpp +++ b/src/pbrt/cpu/integrators.cpp @@ -2867,6 +2867,8 @@ void SPPMIntegrator::Render() { Options->disableWavelengthJitter ? Float(0.5) : RadicalInverse(1, iter); const SampledWavelengths passLambda = film.SampleWavelengths(uLambda); + Float timeSample = samplerPrototype.Get1D(); + ParallelFor2D(pixelBounds, [&](Bounds2i tileBounds) { // Follow camera paths for _tileBounds_ in image for SPPM ScratchBuffer &scratchBuffer = threadScratchBuffers.Get(); @@ -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 crd = camera.GenerateRayDifferential(cs, lambda); if (!crd || !crd->weight) @@ -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; From a04daa38d397afb107dfc9b75d0be912c00ee3a9 Mon Sep 17 00:00:00 2001 From: paulgrassler <63547551+paulgrassler@users.noreply.github.com> Date: Sat, 26 Oct 2024 23:58:47 +0200 Subject: [PATCH 2/2] correcting the sample generation --- src/pbrt/cpu/integrators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pbrt/cpu/integrators.cpp b/src/pbrt/cpu/integrators.cpp index 7a3c18811..a8c541f85 100644 --- a/src/pbrt/cpu/integrators.cpp +++ b/src/pbrt/cpu/integrators.cpp @@ -2867,7 +2867,7 @@ void SPPMIntegrator::Render() { Options->disableWavelengthJitter ? Float(0.5) : RadicalInverse(1, iter); const SampledWavelengths passLambda = film.SampleWavelengths(uLambda); - Float timeSample = samplerPrototype.Get1D(); + Float timeSample = RadicalInverse(2, iter); ParallelFor2D(pixelBounds, [&](Bounds2i tileBounds) { // Follow camera paths for _tileBounds_ in image for SPPM