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:
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r--intern/cycles/render/nodes.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 9f12fe6002f..45f0ab41775 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -1566,6 +1566,34 @@ void MixClosureNode::compile(OSLCompiler& compiler)
compiler.add(this, "node_mix_closure");
}
+/* Invert */
+
+InvertNode::InvertNode()
+: ShaderNode("invert")
+{
+ add_input("Fac", SHADER_SOCKET_FLOAT, 1.0f);
+ add_input("Color", SHADER_SOCKET_COLOR);
+ add_output("Color", SHADER_SOCKET_COLOR);
+}
+
+void InvertNode::compile(SVMCompiler& compiler)
+{
+ ShaderInput *fac_in = input("Fac");
+ ShaderInput *color_in = input("Color");
+ ShaderOutput *color_out = output("Color");
+
+ compiler.stack_assign(fac_in);
+ compiler.stack_assign(color_in);
+ compiler.stack_assign(color_out);
+
+ compiler.add_node(NODE_INVERT, fac_in->stack_offset, color_in->stack_offset, color_out->stack_offset);
+}
+
+void InvertNode::compile(OSLCompiler& compiler)
+{
+ compiler.add(this, "node_invert");
+}
+
/* Mix */
MixNode::MixNode()