Fix wrong update with shadow catcher and transparent film

This change fixes an issue when scene has a shadow catcher and film is
configured to be transparent. Starting viewport render and making the
background non-transparent will cause bad memory access (wrong render
and possibly crash).

Film passes depends on transparency of background, so check for this.

Demo file: F10650585

Differential Revision: https://developer.blender.org/D12666
This commit is contained in:
Sergey Sharybin 2021-09-28 14:37:59 +02:00
parent 640c4ace0b
commit f17ca53cdd
1 changed files with 2 additions and 1 deletions

View File

@ -434,7 +434,8 @@ void Film::update_passes(Scene *scene, bool add_sample_count_pass)
const ObjectManager *object_manager = scene->object_manager;
Integrator *integrator = scene->integrator;
if (!is_modified() && !object_manager->need_update() && !integrator->is_modified()) {
if (!is_modified() && !object_manager->need_update() && !integrator->is_modified() &&
!background->is_modified()) {
return;
}