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
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-09-02 10:58:41 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-09-02 10:58:41 +0300
commitb399a6d33f9b133a26d38fd0e1e5321cbef0693b (patch)
tree4d89cc16d82db6da406d87b71a0df477e9f387be
parentfce8f24628d283baf50addd9392f5ae3c4acfd5a (diff)
Fix T49180: Cycles MIS Map for Animated Environment Texture Movie Doesn't Update on Frame Change
Not really ideal fix at all, but we are at RC today, so better to play really safe.
-rw-r--r--intern/cycles/render/light.cpp10
-rw-r--r--intern/cycles/render/light.h3
-rw-r--r--intern/cycles/render/shader.cpp10
3 files changed, 23 insertions, 0 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp
index 4cd77f8c6e1..787e5cf07b2 100644
--- a/intern/cycles/render/light.cpp
+++ b/intern/cycles/render/light.cpp
@@ -177,6 +177,16 @@ LightManager::~LightManager()
{
}
+bool LightManager::has_background_light(Scene *scene)
+{
+ foreach(Light *light, scene->lights) {
+ if(light->type == LIGHT_BACKGROUND) {
+ return true;
+ }
+ }
+ return false;
+}
+
void LightManager::disable_ineffective_light(Device *device, Scene *scene)
{
/* Make all lights enabled by default, and perform some preliminary checks
diff --git a/intern/cycles/render/light.h b/intern/cycles/render/light.h
index 745caa96159..040a672937d 100644
--- a/intern/cycles/render/light.h
+++ b/intern/cycles/render/light.h
@@ -91,6 +91,9 @@ public:
void tag_update(Scene *scene);
+ /* Check whether there is a background light. */
+ bool has_background_light(Scene *scene);
+
protected:
/* Optimization: disable light which is either unsupported or
* which doesn't contribute to the scene or which is only used for MIS
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index 165a316ea76..10c3507e3f4 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -221,6 +221,16 @@ void Shader::tag_update(Scene *scene)
if(use_mis && has_surface_emission)
scene->light_manager->need_update = true;
+ /* Special handle of background MIS light for now: for some reason it
+ * has use_mis set to false. We are quite close to release now, so
+ * better to be safe.
+ */
+ if(this == scene->default_background &&
+ scene->light_manager->has_background_light(scene))
+ {
+ scene->light_manager->need_update = true;
+ }
+
/* quick detection of which kind of shaders we have to avoid loading
* e.g. surface attributes when there is only a volume shader. this could
* be more fine grained but it's better than nothing */