diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-19 10:36:14 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-05-19 10:36:14 +0300 |
commit | 1f46da922a98c6badf6e2de13304358b3b0b7576 (patch) | |
tree | b4e6a47524627ad6f7a925876eecbccf9cf542b6 /intern/cycles/render/shader.cpp | |
parent | f95828a0182acb7c1ba0fa8afccd6acdf23bc5c2 (diff) | |
parent | 4a04d7ae8930502037cd23dc94ed1bc9bc0043ac (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/blenloader/intern/versioning_270.c
source/blender/depsgraph/intern/depsgraph_tag.cc
source/blender/editors/mask/mask_draw.c
Diffstat (limited to 'intern/cycles/render/shader.cpp')
-rw-r--r-- | intern/cycles/render/shader.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp index ef89288f167..a64f227a38c 100644 --- a/intern/cycles/render/shader.cpp +++ b/intern/cycles/render/shader.cpp @@ -241,6 +241,10 @@ void Shader::set_graph(ShaderGraph *graph_) delete graph_bump; graph = graph_; graph_bump = NULL; + + /* Store info here before graph optimization to make sure that + * nodes that get optimized away still count. */ + has_volume_connected = (graph->output()->input("Volume")->link != NULL); } void Shader::tag_update(Scene *scene) @@ -432,15 +436,14 @@ void ShaderManager::device_update_common(Device *device, flag |= SD_HAS_VOLUME; has_volumes = true; - /* in this case we can assume transparent surface */ - if(!shader->has_surface) - flag |= SD_HAS_ONLY_VOLUME; - /* todo: this could check more fine grained, to skip useless volumes * enclosed inside an opaque bsdf. */ flag |= SD_HAS_TRANSPARENT_SHADOW; } + /* in this case we can assume transparent surface */ + if(shader->has_volume_connected && !shader->has_surface) + flag |= SD_HAS_ONLY_VOLUME; if(shader->heterogeneous_volume && shader->has_volume_spatial_varying) flag |= SD_HETEROGENEOUS_VOLUME; if(shader->has_bssrdf_bump) |