Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-03-30 16:40:40 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-03-30 16:41:33 +0300
commit88d94d89fadd9d7933f26679aeb0d1c2fa86fe34 (patch)
tree8b748ff5ea445bd242e9b57244830d668e9dbe0f /intern
parentf1fe42d912f088259bbc82d597121978204e991d (diff)
Fix T87007: Cycles Background not updated if strength is initially null
When the strength is initially set to zero, the shader graph is optimized out to remove any node which will not be executed because of this, which removes pretty much every single node, except for the output. As the graph is empty, the world shader is made invisible to rays so it is not evaluated in the kernel. However, when the strength is then modified, the Background is not updated as the modification happens on the Shader Node and not on the Background Node, so it is never tagged as modified. To fix this, we need to tag the Background as modified when its shader is also modified so the Kernel data is properly updated. Regression caused by rBbbe6d44928235cd4a5cfbeaf1a1de78ed861bb92.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/render/background.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/intern/cycles/render/background.cpp b/intern/cycles/render/background.cpp
index b3d383afae4..f0a779da012 100644
--- a/intern/cycles/render/background.cpp
+++ b/intern/cycles/render/background.cpp
@@ -130,6 +130,14 @@ void Background::device_free(Device * /*device*/, DeviceScene * /*dscene*/)
void Background::tag_update(Scene *scene)
{
+ Shader *bg_shader = get_shader(scene);
+ if (bg_shader && bg_shader->is_modified()) {
+ /* Tag as modified to update the KernelBackground visibility information.
+ * We only tag the use_shader socket as modified as it is related to the shader
+ * and to avoid doing unnecessary updates anywhere else. */
+ tag_use_shader_modified();
+ }
+
if (ao_factor_is_modified() || use_ao_is_modified()) {
scene->integrator->tag_update(scene, Integrator::BACKGROUND_AO_MODIFIED);
}