Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Time Sampling/Motion Blur for SPPM #441

Merged
merged 2 commits into from
Oct 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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