diff options
Diffstat (limited to 'intern/cycles/render/graph.cpp')
-rw-r--r-- | intern/cycles/render/graph.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp index 8b179f742c4..3a9e2981418 100644 --- a/intern/cycles/render/graph.cpp +++ b/intern/cycles/render/graph.cpp @@ -745,7 +745,7 @@ void ShaderGraph::clean(Scene *scene) vector<bool> visited(num_node_ids, false); vector<bool> on_stack(num_node_ids, false); - + /* break cycles */ break_cycles(output(), visited, on_stack); @@ -860,7 +860,7 @@ void ShaderGraph::refine_bump_nodes() copy_nodes(nodes_bump, nodes_dx); copy_nodes(nodes_bump, nodes_dy); - + /* mark nodes to indicate they are use for bump computation, so that any texture coordinates are shifted by dx/dy when sampling */ foreach(ShaderNode *node, nodes_bump) @@ -876,13 +876,13 @@ void ShaderGraph::refine_bump_nodes() connect(out_dx, node->input("SampleX")); connect(out_dy, node->input("SampleY")); - + /* add generated nodes */ foreach(NodePair& pair, nodes_dx) add(pair.second); foreach(NodePair& pair, nodes_dy) add(pair.second); - + /* connect what is connected is bump to samplecenter input*/ connect(out , node->input("SampleCenter")); @@ -941,7 +941,7 @@ void ShaderGraph::bump_from_displacement(bool use_object_space) * this for bump from displacement, this will be the only bump allowed to * overwrite the shader normal */ ShaderNode *set_normal = add(new SetNormalNode()); - + /* add bump node and connect copied graphs to it */ BumpNode *bump = (BumpNode*)add(new BumpNode()); bump->use_object_space = use_object_space; @@ -973,7 +973,7 @@ void ShaderGraph::bump_from_displacement(bool use_object_space) connect(dot_center->output("Value"), bump->input("SampleCenter")); connect(dot_dx->output("Value"), bump->input("SampleX")); connect(dot_dy->output("Value"), bump->input("SampleY")); - + /* connect the bump out to the set normal in: */ connect(bump->output("Normal"), set_normal->input("Direction")); @@ -996,7 +996,7 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight * the graph into nodes that feed weights into closure nodes. this is too * avoid building a closure tree and then flattening it, and instead write it * directly to an array */ - + if(node->special_type == SHADER_SPECIAL_TYPE_COMBINE_CLOSURE) { ShaderInput *fin = node->input("Fac"); ShaderInput *cl1in = node->input("Closure1"); @@ -1007,8 +1007,8 @@ void ShaderGraph::transform_multi_closure(ShaderNode *node, ShaderOutput *weight /* mix closure: add node to mix closure weights */ MixClosureWeightNode *mix_node = new MixClosureWeightNode(); add(mix_node); - ShaderInput *fac_in = mix_node->input("Fac"); - ShaderInput *weight_in = mix_node->input("Weight"); + ShaderInput *fac_in = mix_node->input("Fac"); + ShaderInput *weight_in = mix_node->input("Weight"); if(fin->link) connect(fin->link, fac_in); @@ -1091,6 +1091,9 @@ int ShaderGraph::get_num_closures() else if(CLOSURE_IS_VOLUME(closure_type)) { num_closures += VOLUME_STACK_SIZE; } + else if(closure_type == CLOSURE_BSDF_HAIR_PRINCIPLED_ID) { + num_closures += 4; + } else { ++num_closures; } @@ -1171,4 +1174,3 @@ void ShaderGraph::dump_graph(const char *filename) } CCL_NAMESPACE_END - |