1
1

Fix missing samples count pass when using tiles

Samples count pass is normalized to the overall number of samples.
This means that we need to store actual value of the samples in the
tile buffer file.

A bit annoying to pull all those settings to BufferParams and need
to find a more generic solution, but for now this is easiest and a
quickest solution.

Differential Revision: https://developer.blender.org/D12597
This commit is contained in:
2021-09-22 13:05:09 +02:00
parent f7a492d460
commit 9f6313498a
4 changed files with 4 additions and 4 deletions

View File

@@ -933,10 +933,7 @@ void PathTrace::process_full_buffer_from_disk(string_view filename)
int PathTrace::get_num_render_tile_samples() const
{
if (full_frame_state_.render_buffers) {
/* If the full-frame buffer is read from disk the number of samples is not used as there is a
* sample count pass for that in the buffer. Just avoid access to badly defined state of the
* path state. */
return 0;
return full_frame_state_.render_buffers->params.samples;
}
return render_scheduler_.get_num_rendered_samples();

View File

@@ -105,6 +105,7 @@ NODE_DEFINE(BufferParams)
SOCKET_STRING(layer, "Layer", ustring());
SOCKET_STRING(view, "View", ustring());
SOCKET_INT(samples, "Samples", 0);
SOCKET_FLOAT(exposure, "Exposure", 1.0f);
SOCKET_BOOLEAN(use_approximate_shadow_catcher, "Use Approximate Shadow Catcher", false);
SOCKET_BOOLEAN(use_transparent_background, "Transparent Background", false);

View File

@@ -98,6 +98,7 @@ class BufferParams : public Node {
vector<BufferPass> passes;
ustring layer;
ustring view;
int samples = 0;
float exposure = 1.0f;
bool use_approximate_shadow_catcher = false;
bool use_transparent_background = false;

View File

@@ -407,6 +407,7 @@ void Session::do_delayed_reset()
buffer_params_ = delayed_reset_.buffer_params;
/* Store parameters used for buffers access outside of scene graph. */
buffer_params_.samples = params.samples;
buffer_params_.exposure = scene->film->get_exposure();
buffer_params_.use_approximate_shadow_catcher =
scene->film->get_use_approximate_shadow_catcher();