diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-28 13:37:44 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-28 13:37:44 +0300 |
commit | df0052964860ad98d1147400d256029d519a313b (patch) | |
tree | 2f9bc1fdd5a504aaf5695827cb99e7f7951043eb /intern/cycles/render/light.cpp | |
parent | 9f18e3acd6bffb15a268e4375394328d9869ac38 (diff) |
Cycles: Fix missing mesh flags update when tweaking shaders
This is a bit weak, but better than tagging whole mesh manager for update.
Maybe we'll solve such dual-look up in the future.
This commit finally solves T48963: Noise when changing Diffuse node to Emission node
Diffstat (limited to 'intern/cycles/render/light.cpp')
-rw-r--r-- | intern/cycles/render/light.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/intern/cycles/render/light.cpp b/intern/cycles/render/light.cpp index d97c1aefc89..ae6042cef34 100644 --- a/intern/cycles/render/light.cpp +++ b/intern/cycles/render/light.cpp @@ -220,10 +220,16 @@ bool LightManager::object_usable_as_light(Object *object) { return false; } /* Skip if we have no emission shaders. */ - if(!mesh->has_mis_emission) { - return false; + /* TODO(sergey): Ideally we want to avoid such duplicated loop, since it'll + * iterate all mesh shaders twice (when counting and when calculating + * triangle area. + */ + foreach(const Shader *shader, mesh->used_shaders) { + if(shader->use_mis && shader->has_surface_emission) { + return true; + } } - return true; + return false; } void LightManager::device_update_distribution(Device *device, DeviceScene *dscene, Scene *scene, Progress& progress) |