Skip to content

Commit

Permalink
refactor: delete BSDF from SurfaceInteraction::SpawnRay() as it was n…
Browse files Browse the repository at this point in the history
…ever used
  • Loading branch information
w3ntao committed Nov 23, 2024
1 parent 1ae72cf commit 805add6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/pbrt/cpu/integrators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ void LightPathIntegrator::EvaluatePixelSample(Point2i pPixel, int sampleIndex,
if (!bs)
break;
beta *= bs->f * AbsDot(bs->wi, isect.shading.n) / bs->pdf;
ray = isect.SpawnRay(ray, bsdf, bs->wi, bs->flags, bs->eta);
ray = isect.SpawnRay(ray, bs->wi, bs->flags, bs->eta);
}
}

Expand Down Expand Up @@ -745,7 +745,7 @@ SampledSpectrum PathIntegrator::Li(RayDifferential ray, SampledWavelengths &lamb
etaScale *= Sqr(bs->eta);
prevIntrCtx = si->intr;

ray = isect.SpawnRay(ray, bsdf, bs->wi, bs->flags, bs->eta);
ray = isect.SpawnRay(ray, bs->wi, bs->flags, bs->eta);

// Possibly terminate the path with Russian roulette
SampledSpectrum rrBeta = beta * etaScale;
Expand Down Expand Up @@ -1182,7 +1182,7 @@ SampledSpectrum VolPathIntegrator::Li(RayDifferential ray, SampledWavelengths &l
anyNonSpecularBounces |= !bs->IsSpecular();
if (bs->IsTransmission())
etaScale *= Sqr(bs->eta);
ray = isect.SpawnRay(ray, bsdf, bs->wi, bs->flags, bs->eta);
ray = isect.SpawnRay(ray, bs->wi, bs->flags, bs->eta);

// Account for attenuated subsurface scattering, if applicable
BSSRDF bssrdf = isect.GetBSSRDF(ray, lambda, camera, scratchBuffer);
Expand Down Expand Up @@ -2096,7 +2096,7 @@ int RandomWalk(const Integrator &integrator, SampledWavelengths &lambda,
pdfFwd = bs->pdfIsProportional ? bsdf.PDF(wo, bs->wi, mode) : bs->pdf;
anyNonSpecularBounces |= !bs->IsSpecular();
beta *= bs->f * AbsDot(bs->wi, isect.shading.n) / bs->pdf;
ray = isect.SpawnRay(ray, bsdf, bs->wi, bs->flags, bs->eta);
ray = isect.SpawnRay(ray, bs->wi, bs->flags, bs->eta);

// Compute path probabilities at surface vertex
// TODO: confirm. I believe that !mode is right. Interestingly,
Expand Down Expand Up @@ -2988,7 +2988,7 @@ void SPPMIntegrator::Render() {
break;
beta /= 1 - q;
}
ray = isect.SpawnRay(ray, bsdf, bs->wi, bs->flags, bs->eta);
ray = isect.SpawnRay(ray, bs->wi, bs->flags, bs->eta);
prevIntrCtx = LightSampleContext(isect);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/pbrt/interaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ PBRT_CPU_GPU void SurfaceInteraction::SkipIntersection(RayDifferential *ray, Flo
}

PBRT_CPU_GPU RayDifferential SurfaceInteraction::SpawnRay(const RayDifferential &rayi,
const BSDF &bsdf, Vector3f wi, int flags,
Vector3f wi, int flags,
Float eta) const {
RayDifferential rd(SpawnRay(wi));
if (rayi.hasDifferentials) {
Expand Down
2 changes: 1 addition & 1 deletion src/pbrt/interaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class SurfaceInteraction : public Interaction {

using Interaction::SpawnRay;
PBRT_CPU_GPU
RayDifferential SpawnRay(const RayDifferential &rayi, const BSDF &bsdf, Vector3f wi,
RayDifferential SpawnRay(const RayDifferential &rayi, Vector3f wi,
int /*BxDFFlags*/ flags, Float eta) const;

BSDF GetBSDF(const RayDifferential &ray, SampledWavelengths &lambda, Camera camera,
Expand Down

0 comments on commit 805add6

Please sign in to comment.