diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-20 15:42:26 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-20 16:03:14 +0300 |
commit | 1613c994b069ddab170dd5af9b8f23a31541dec3 (patch) | |
tree | 9016b299c9ba808d3bb6cd7defc466275a963461 /intern/cycles/render/light.cpp | |
parent | bb692a2d0f78cc5702aee9fceda4fa500ec5d7e8 (diff) |
Fix Cycles not correctly using Background.shader if specified
Based on patch by Alex Fuller.
Differential Revision: https://developer.blender.org/D6627
Diffstat (limited to 'intern/cycles/render/light.cpp')
-rw-r--r-- | intern/cycles/render/light.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index 06304205dc9..664217d6f26 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -219,8 +219,7 @@ void LightManager::disable_ineffective_light(Scene *scene) * - If unsupported on a device * - If we don't need it (no HDRs etc.) */ - Shader *shader = (scene->background->shader) ? scene->background->shader : - scene->default_background; + Shader *shader = scene->background->get_shader(scene); const bool disable_mis = !(has_portal || shader->has_surface_spatial_varying); VLOG_IF(1, disable_mis) << "Background MIS has been disabled.\n"; foreach (Light *light, scene->lights) { @@ -569,8 +568,7 @@ void LightManager::device_update_background(Device *device, int2 res = make_int2(background_light->map_resolution, background_light->map_resolution / 2); /* If the resolution isn't set manually, try to find an environment texture. */ if (res.x == 0) { - Shader *shader = (scene->background->shader) ? scene->background->shader : - scene->default_background; + Shader *shader = scene->background->get_shader(scene); foreach (ShaderNode *node, shader->graph->nodes) { if (node->type == EnvironmentTextureNode::node_type) { EnvironmentTextureNode *env = (EnvironmentTextureNode *)node; |