Fix T79219: Cycles NLM denoiser clean passes broken after recent changes

This commit is contained in:
Brecht Van Lommel 2020-07-28 13:01:31 +02:00
parent f0c4566ce3
commit 75e16c22d7
Notes: blender-bot 2023-02-14 07:08:26 +01:00
Referenced by issue #79219, Cycles NLM denoiser: clean lighting pass is broken
2 changed files with 16 additions and 18 deletions

View File

@ -492,27 +492,15 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
/* Update denoising parameters. */
session->set_denoising(session_params.denoising);
bool use_denoising = session_params.denoising.use;
bool store_denoising_passes = session_params.denoising.store_passes;
buffer_params.denoising_data_pass = use_denoising || store_denoising_passes;
buffer_params.denoising_clean_pass = (scene->film->denoising_flags & DENOISING_CLEAN_ALL_PASSES);
buffer_params.denoising_prefiltered_pass = store_denoising_passes &&
session_params.denoising.type == DENOISER_NLM;
scene->film->denoising_data_pass = buffer_params.denoising_data_pass;
scene->film->denoising_clean_pass = buffer_params.denoising_clean_pass;
scene->film->denoising_prefiltered_pass = buffer_params.denoising_prefiltered_pass;
/* Add passes */
/* Compute render passes and film settings. */
vector<Pass> passes = sync->sync_render_passes(
b_rlay, b_view_layer, session_params.adaptive_sampling, session_params.denoising);
buffer_params.passes = passes;
scene->film->pass_alpha_threshold = b_view_layer.pass_alpha_threshold();
scene->film->tag_passes_update(scene, passes);
scene->film->tag_update(scene);
scene->integrator->tag_update(scene);
/* Set buffer params, using film settings from sync_render_passes. */
buffer_params.passes = passes;
buffer_params.denoising_data_pass = scene->film->denoising_data_pass;
buffer_params.denoising_clean_pass = scene->film->denoising_clean_pass;
buffer_params.denoising_prefiltered_pass = scene->film->denoising_prefiltered_pass;
BL::RenderResult::views_iterator b_view_iter;

View File

@ -697,6 +697,16 @@ vector<Pass> BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay,
}
RNA_END;
scene->film->denoising_data_pass = denoising.use || denoising.store_passes;
scene->film->denoising_clean_pass = (scene->film->denoising_flags & DENOISING_CLEAN_ALL_PASSES);
scene->film->denoising_prefiltered_pass = denoising.store_passes &&
denoising.type == DENOISER_NLM;
scene->film->pass_alpha_threshold = b_view_layer.pass_alpha_threshold();
scene->film->tag_passes_update(scene, passes);
scene->film->tag_update(scene);
scene->integrator->tag_update(scene);
return passes;
}