diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-12-18 19:34:06 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-12-18 19:34:06 +0400 |
commit | 5f6bd44c82bef24a43696449d8b905beeb53015b (patch) | |
tree | 7e955e53c4e9ee8a44c716b79ceaeebc34511b08 /intern/cycles/render/nodes.cpp | |
parent | b49463c439820c5039caf63421bdc8f3a58554b2 (diff) |
Generalized node groups for Cycles.
This allows group nodes inside other group nodes in cycles and makes the
code more generic for all possible cases, like direct group
input-to-output links and unused group sockets.
Previous code tried to connect external nodes and internal group sockets
by following links until a "real" node input/output. This quickly
becomes complicated in corner cases as described above and can lead to
unexpected behavior when the group socket is of a different type than
the internal/external sockets, but that conversion is skipped.
The new code uses the concept of "proxy nodes" similar to what the new
compositor does. Each group socket is replaced with a proxy node with a
single input and output, to which other nodes in the same tree and
internal nodes can link to. After all groups have been expanded in the
graph, these proxy nodes are removed again, adding converter nodes if
necessary.
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 5cabb248709..7d873221cd6 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -869,6 +869,26 @@ void ConvertNode::compile(OSLCompiler& compiler) assert(0); } +/* Proxy */ + +ProxyNode::ProxyNode(ShaderSocketType from_, ShaderSocketType to_) +: ShaderNode("proxy") +{ + from = from_; + to = to_; + + add_input("Input", from); + add_output("Output", to); +} + +void ProxyNode::compile(SVMCompiler& compiler) +{ +} + +void ProxyNode::compile(OSLCompiler& compiler) +{ +} + /* BSDF Closure */ BsdfNode::BsdfNode() |