Skip to content

Commit

Permalink
Normalize pixel variation wrt. user noise threshold
Browse files Browse the repository at this point in the history
Fixes issue appleseedhq#2404.
  • Loading branch information
kushWithoutWax authored and dictoon committed Apr 7, 2019
1 parent 60b24a1 commit 235bfe4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,8 @@ namespace

size_t tile_converged_pixel_count = 0;
float average_noise_level = 0.0f;

const float normalizing_factor = 1.0f / m_params.m_noise_threshold;

for (size_t i = 0, n = rendering_blocks.size(); i < n; ++i)
{
const PixelBlock& pb = rendering_blocks[i];
Expand Down Expand Up @@ -542,7 +543,7 @@ namespace
{
Color3f variation;
m_variation_aov_tile->get_pixel(pt.x, pt.y, variation);
variation[0] += pb.m_block_error;
variation[0] += pb.m_block_error * normalizing_factor ;
m_variation_aov_tile->set_pixel(pt.x, pt.y, variation);
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/appleseed/renderer/modeling/aov/pixelvariationaov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ namespace
ColorMap color_map;
color_map.set_palette_from_array(InfernoColorMap, countof(InfernoColorMap) / 3);

float min_var, max_var;
color_map.find_min_max_red_channel(*m_image, crop_window, min_var, max_var);
color_map.remap_red_channel(*m_image, crop_window, min_var, max_var);
// Clamps the pixel variation in the red channel between 0 and 1.
// No normalization happens here.
color_map.remap_red_channel(*m_image, crop_window, 0.0f, 1.0f);
}

const char* get_model() const override
Expand Down

0 comments on commit 235bfe4

Please sign in to comment.