Skip to content

Commit

Permalink
Revert "Add rrThreshold parameter to Path and VolPath integrators."
Browse files Browse the repository at this point in the history
This reverts commit a636c94.
  • Loading branch information
mmp committed Aug 21, 2016
1 parent ab09784 commit be62627
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
15 changes: 7 additions & 8 deletions src/integrators/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@
*/


// integrators/path.cpp*
#include "integrators/path.h"
#include "bssrdf.h"
#include "camera.h"
#include "film.h"
#include "scene.h"
#include "interaction.h"
#include "paramset.h"
#include "scene.h"
#include "bssrdf.h"
#include "stats.h"
#include "film.h"
#include "camera.h"

STAT_PERCENT("Integrator/Zero-radiance paths", zeroRadiancePaths, totalPaths);
STAT_INT_DISTRIBUTION("Integrator/Path length", pathLength);
Expand Down Expand Up @@ -142,7 +143,7 @@ Spectrum PathIntegrator::Li(const RayDifferential &r, const Scene &scene,
}

// Possibly terminate the path with Russian roulette
if (beta.y() < rrThreshold && bounces > 3) {
if (bounces > 3) {
Float q = std::max((Float).05, 1 - beta.y());
if (sampler.Get1D() < q) break;
beta /= 1 - q;
Expand Down Expand Up @@ -171,7 +172,5 @@ PathIntegrator *CreatePathIntegrator(const ParamSet &params,
Error("Degenerate \"pixelbounds\" specified.");
}
}
Float rrThreshold = params.FindOneFloat("rrthreshold", 1.);
return new PathIntegrator(maxDepth, camera, sampler, pixelBounds,
rrThreshold);
return new PathIntegrator(maxDepth, camera, sampler, pixelBounds);
}
7 changes: 2 additions & 5 deletions src/integrators/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,15 @@ class PathIntegrator : public SamplerIntegrator {
// PathIntegrator Public Methods
PathIntegrator(int maxDepth, std::shared_ptr<const Camera> camera,
std::shared_ptr<Sampler> sampler,
const Bounds2i &pixelBounds, Float rrThreshold = 1)
: SamplerIntegrator(camera, sampler, pixelBounds),
maxDepth(maxDepth),
rrThreshold(rrThreshold) {}
const Bounds2i &pixelBounds)
: SamplerIntegrator(camera, sampler, pixelBounds), maxDepth(maxDepth) {}
void Preprocess(const Scene &scene, Sampler &sampler);
Spectrum Li(const RayDifferential &ray, const Scene &scene,
Sampler &sampler, MemoryArena &arena, int depth) const;

private:
// PathIntegrator Private Data
const int maxDepth;
const Float rrThreshold;
};

PathIntegrator *CreatePathIntegrator(const ParamSet &params,
Expand Down
13 changes: 6 additions & 7 deletions src/integrators/volpath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
*/


// integrators/volpath.cpp*
#include "integrators/volpath.h"
#include "scene.h"
#include "interaction.h"
#include "paramset.h"
#include "bssrdf.h"
#include "camera.h"
#include "film.h"
#include "interaction.h"
#include "paramset.h"
#include "scene.h"
#include "stats.h"

STAT_FLOAT_DISTRIBUTION("Integrator/Path length", pathLength);
Expand Down Expand Up @@ -157,7 +158,7 @@ Spectrum VolPathIntegrator::Li(const RayDifferential &r, const Scene &scene,
}

// Possibly terminate the path with Russian roulette
if (beta.y() < rrThreshold && bounces > 3) {
if (bounces > 3) {
Float q = std::max((Float).05, 1 - beta.y());
if (sampler.Get1D() < q) break;
beta /= 1 - q;
Expand Down Expand Up @@ -186,7 +187,5 @@ VolPathIntegrator *CreateVolPathIntegrator(
Error("Degenerate \"pixelbounds\" specified.");
}
}
Float rrThreshold = params.FindOneFloat("rrthreshold", 1.);
return new VolPathIntegrator(maxDepth, camera, sampler, pixelBounds,
rrThreshold);
return new VolPathIntegrator(maxDepth, camera, sampler, pixelBounds);
}
7 changes: 2 additions & 5 deletions src/integrators/volpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,15 @@ class VolPathIntegrator : public SamplerIntegrator {
// VolPathIntegrator Public Methods
VolPathIntegrator(int maxDepth, std::shared_ptr<const Camera> camera,
std::shared_ptr<Sampler> sampler,
const Bounds2i &pixelBounds, Float rrThreshold = 1)
: SamplerIntegrator(camera, sampler, pixelBounds),
maxDepth(maxDepth),
rrThreshold(rrThreshold) {}
const Bounds2i &pixelBounds)
: SamplerIntegrator(camera, sampler, pixelBounds), maxDepth(maxDepth) {}
void Preprocess(const Scene &scene, Sampler &sampler);
Spectrum Li(const RayDifferential &ray, const Scene &scene,
Sampler &sampler, MemoryArena &arena, int depth) const;

private:
// VolPathIntegrator Private Data
const int maxDepth;
const Float rrThreshold;
};

VolPathIntegrator *CreateVolPathIntegrator(
Expand Down

0 comments on commit be62627

Please sign in to comment.