Cleanup: strip trailing space for cycles
This commit is contained in:
@@ -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);
|
||||
@@ -1171,4 +1171,3 @@ void ShaderGraph::dump_graph(const char *filename)
|
||||
}
|
||||
|
||||
CCL_NAMESPACE_END
|
||||
|
||||
|
||||
Reference in New Issue
Block a user