Commit cfd02ed9 authored by Jan Scheffczyk's avatar Jan Scheffczyk

Changed file naming accordingly

parent cd7e1250
...@@ -293,17 +293,14 @@ namespace pbrt { ...@@ -293,17 +293,14 @@ namespace pbrt {
bokehOptions.innerRadius = params.FindOneFloat("innerRadius", 1.0); bokehOptions.innerRadius = params.FindOneFloat("innerRadius", 1.0);
bokehOptions.rateOfChange = params.FindOneFloat("rateOfChange", 0.0f); bokehOptions.rateOfChange = params.FindOneFloat("rateOfChange", 0.0f);
bokehOptions.weightDistr = params.FindOneInt("weightDistr", 2.0); bokehOptions.weightDistr = params.FindOneFloat("weightDistr", 2.0);
if (bokehOptions.weightDistr % 2 != 0) {
Error("\"weightDistr\" should be divisible by 2. Rounding to next multiple of 2");
bokehOptions.weightDistr++;
}
bokehOptions.weightStrength = params.FindOneFloat("weightStrength", 0.0); bokehOptions.weightStrength = params.FindOneFloat("weightStrength", 0.0);
if (bokehOptions.weightStrength < 0 || bokehOptions.weightStrength > 1) { if (bokehOptions.weightStrength < 0 || bokehOptions.weightStrength > 1) {
Error("For \"weightStrength\" values above 1 or below 0 light conversation is violated"); Error("For \"weightStrength\" values above 1 or below 0 light conversation is violated");
} }
bokehOptions.weightStrength = bokehOptions.weightStrength * bokehOptions.weightDistr; bokehOptions.weightStrength = bokehOptions.weightStrength * (bokehOptions.weightDistr+1);
bokehOptions.integral = bokehOptions.weightStrength / bokehOptions.weightDistr ; bokehOptions.integral = bokehOptions.weightStrength / (bokehOptions.weightDistr+1) ;
if (halffov > 0.f) if (halffov > 0.f)
......
...@@ -55,16 +55,19 @@ namespace pbrt { ...@@ -55,16 +55,19 @@ namespace pbrt {
}; };
struct Bokeh { struct Bokeh {
// also used as type /// also used as type
int blades = 0; int blades = 0;
// strength and distribution of optical vignetting /// strength and distribution of optical vignetting
float radius = 0.5; float radius = 0.5;
float rateOfChange = 2; float rateOfChange = 2;
// caches to avoid recalc /// caches to avoid recalc
float step; float step;
std::unique_ptr<Point2f[]> corners; std::unique_ptr<Point2f[]> corners;
/// Decribes the ratio of the two circle which determine the shape of the bokeh
float innerRadius; float innerRadius;
/// 0 even destribution, <0 center is emphasized, >0 edges are emphasized
int weightDistr; int weightDistr;
/// How strong the distribution is emphazised
float weightStrength; float weightStrength;
float integral; float integral;
}; };
...@@ -189,7 +192,6 @@ namespace pbrt { ...@@ -189,7 +192,6 @@ namespace pbrt {
} }
float power = bokehOptions.weightStrength; float power = bokehOptions.weightStrength;
float distr = bokehOptions.weightDistr; float distr = bokehOptions.weightDistr;
float intg = bokehOptions.integral; float intg = bokehOptions.integral;
......
...@@ -282,7 +282,7 @@ std::vector<TestIntegrator> GetIntegrators() { ...@@ -282,7 +282,7 @@ std::vector<TestIntegrator> GetIntegrators() {
std::shared_ptr<Camera> camera = std::shared_ptr<Camera> camera =
std::make_shared<PerspectiveCamera>( std::make_shared<PerspectiveCamera>(
identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1., identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1.,
0., 10., 45, film, nullptr); 0., 10., 45, film, nullptr, Bokeh());
Integrator *integrator = Integrator *integrator =
new PathIntegrator(8, camera, sampler.first, new PathIntegrator(8, camera, sampler.first,
...@@ -322,7 +322,7 @@ std::vector<TestIntegrator> GetIntegrators() { ...@@ -322,7 +322,7 @@ std::vector<TestIntegrator> GetIntegrators() {
std::shared_ptr<Camera> camera = std::shared_ptr<Camera> camera =
std::make_shared<PerspectiveCamera>( std::make_shared<PerspectiveCamera>(
identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1., identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1.,
0., 10., 45, film, nullptr); 0., 10., 45, film, nullptr,Bokeh());
Integrator *integrator = Integrator *integrator =
new VolPathIntegrator(8, camera, sampler.first, new VolPathIntegrator(8, camera, sampler.first,
...@@ -362,7 +362,7 @@ std::vector<TestIntegrator> GetIntegrators() { ...@@ -362,7 +362,7 @@ std::vector<TestIntegrator> GetIntegrators() {
std::shared_ptr<Camera> camera = std::shared_ptr<Camera> camera =
std::make_shared<PerspectiveCamera>( std::make_shared<PerspectiveCamera>(
identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1., identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1.,
0., 10., 45, film, nullptr); 0., 10., 45, film, nullptr,Bokeh());
Integrator *integrator = Integrator *integrator =
new BDPTIntegrator(sampler.first, camera, 6, false, false, new BDPTIntegrator(sampler.first, camera, 6, false, false,
...@@ -400,7 +400,7 @@ std::vector<TestIntegrator> GetIntegrators() { ...@@ -400,7 +400,7 @@ std::vector<TestIntegrator> GetIntegrators() {
std::shared_ptr<Camera> camera = std::shared_ptr<Camera> camera =
std::make_shared<PerspectiveCamera>( std::make_shared<PerspectiveCamera>(
identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1., identity, Bounds2f(Point2f(-1, -1), Point2f(1, 1)), 0., 1.,
0., 10., 45, film, nullptr); 0., 10., 45, film, nullptr,Bokeh());
Integrator *integrator = new MLTIntegrator( Integrator *integrator = new MLTIntegrator(
camera, 8 /* depth */, 100000 /* n bootstrap */, camera, 8 /* depth */, 100000 /* n bootstrap */,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment