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:
authorThomas Dinges <blender@dingto.org>2015-06-12 00:09:38 +0300
committerThomas Dinges <blender@dingto.org>2015-06-12 00:09:38 +0300
commitb66659377598999f2596288415c3b52224388532 (patch)
treecbfeda36a42492fca303cf814eb685f86dc911e9 /intern/cycles/render/graph.cpp
parent96d9801423be600268afc57c078063cd9906f609 (diff)
Cycles: Remove Bump Node from the graph, if Height input is not connected.
This way we can avoid building the split kernel with NODE_FEATURE_BUMP enabled, in case we don't need it.
Diffstat (limited to 'intern/cycles/render/graph.cpp')
-rw-r--r--intern/cycles/render/graph.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index 9adf6b4b1ed..e0537101247 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -419,6 +419,21 @@ void ShaderGraph::remove_unneeded_nodes()
}
}
}
+ else if(node->special_type == SHADER_SPECIAL_TYPE_BUMP) {
+ BumpNode *bump = static_cast<BumpNode*>(node);
+
+ if(bump->outputs[0]->links.size()) {
+ /* Height input not connected */
+ /* ToDo: Strength zero? */
+ if(!bump->inputs[0]->link) {
+ vector<ShaderInput*> inputs = bump->outputs[0]->links;
+
+ relink(bump->inputs, inputs, NULL);
+ removed[bump->id] = true;
+ any_node_removed = true;
+ }
+ }
+ }
else if(node->special_type == SHADER_SPECIAL_TYPE_MIX_CLOSURE) {
MixClosureNode *mix = static_cast<MixClosureNode*>(node);
@@ -560,7 +575,7 @@ void ShaderGraph::clean()
else
delete node;
}
-
+
nodes = newnodes;
}