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:
authorAlexander Gavrilov <angavrilov@gmail.com>2016-08-02 12:08:04 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2016-08-02 12:08:48 +0300
commitca6f53d15ea9273eb396f7b2c0d1b611ce6b7d0a (patch)
tree8f55a9364775785b20294b49eae4ac8e4db4a50d /intern/cycles/test
parentde3181bc387223f343181388238bac472a190899 (diff)
Cycles: tweak some folding tests to avoid unnecessary type conversion.
It's easy to connect a simple value to output without forcing conversion to color by using the Strength socket of Emission.
Diffstat (limited to 'intern/cycles/test')
-rw-r--r--intern/cycles/test/render_graph_finalize_test.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/intern/cycles/test/render_graph_finalize_test.cpp b/intern/cycles/test/render_graph_finalize_test.cpp
index e329384021a..cf4083c23db 100644
--- a/intern/cycles/test/render_graph_finalize_test.cpp
+++ b/intern/cycles/test/render_graph_finalize_test.cpp
@@ -140,6 +140,14 @@ public:
.output_closure("EmissionNode::Emission");
}
+ ShaderGraphBuilder& output_value(const string& from)
+ {
+ return (*this)
+ .add_node(ShaderNodeBuilder<EmissionNode>("EmissionNode"))
+ .add_connection(from, "EmissionNode::Strength")
+ .output_closure("EmissionNode::Emission");
+ }
+
protected:
ShaderGraph *graph_;
map<string, ShaderNode *> node_map_;
@@ -955,7 +963,7 @@ TEST(render_graph, constant_fold_math)
.set(&MathNode::use_clamp, false)
.set("Value1", 0.7f)
.set("Value2", 0.9f))
- .output_color("Math::Value");
+ .output_value("Math::Value");
graph.finalize(&scene);
}
@@ -976,7 +984,7 @@ TEST(render_graph, constant_fold_math_clamp)
.set(&MathNode::use_clamp, true)
.set("Value1", 0.7f)
.set("Value2", 0.9f))
- .output_color("Math::Value");
+ .output_value("Math::Value");
graph.finalize(&scene);
}
@@ -1007,7 +1015,7 @@ static void build_math_partial_test_graph(ShaderGraphBuilder &builder, NodeMath
.set(&MathNode::use_clamp, true))
.add_connection("Math_Cx::Value", "Out::Value1")
.add_connection("Math_xC::Value", "Out::Value2")
- .output_color("Out::Value");
+ .output_value("Out::Value");
}
/*