Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
fix: correct behaviour for confocal sensors in nloscapturemeter
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoroyo committed Dec 12, 2022
1 parent 7a72e52 commit eed4827
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/sensors/nloscapturemeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class NLOSCaptureMeter final : public Sensor<Float, Spectrum> {
m_laser_origin = props.point3f("laser_origin", 0.f);
Point3f laser_lookat3_pixel = props.point3f("laser_lookat_pixel", -1.f);
Point3f laser_lookat3_3d = props.point3f("laser_lookat_3d", 0.f);
m_laser_lookat_is_pixel = all(laser_lookat3_pixel > 0.f);
m_laser_lookat_is_pixel = laser_lookat3_pixel.x() > 0.f && laser_lookat3_pixel.y() > 0.f;
if (m_laser_lookat_is_pixel) {
auto [film_width, film_height] = film_size();
if (laser_lookat3_pixel.x() < 0 ||
Expand All @@ -136,6 +136,7 @@ class NLOSCaptureMeter final : public Sensor<Float, Spectrum> {
m_film_size = m_film->size();
if (m_is_confocal) {
const_cast<ScalarVector2i &>(m_film->size()) = ScalarVector2i(1, 1);
const_cast<ScalarVector2i &>(m_film->crop_size()) = ScalarVector2i(1, 1);
}

auto pmgr = PluginManager::instance();
Expand Down Expand Up @@ -207,8 +208,8 @@ class NLOSCaptureMeter final : public Sensor<Float, Spectrum> {

Point2f pixel_to_sample(const Point2f &pixel) const {
auto [film_width, film_height] = film_size();
return Point2f{ (pixel.x() + 0.5f) / film_width,
(pixel.y() + 0.5f) / film_height };
return Point2f{ pixel.x() / film_width,
pixel.y() / film_height };
}

std::pair<Float, Vector3f>
Expand Down

0 comments on commit eed4827

Please sign in to comment.