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:
authorCarlo Andreacchio <carlorules@gmail.com>2014-04-21 16:20:29 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-04-21 16:44:36 +0400
commit7765b73f6d2002b074b7e78985171ef035075fbb (patch)
treeea3bff55c5c71ba4800bb11b044f403928dd3a6d /intern/cycles/render/nodes.cpp
parentf8cd3d974dafe1482c49a87a2ede68d9defe7ef9 (diff)
Cycles: add Transparent Depth output to Light Path node.
This can for example be useful if you want to manually terminate the path at some point and use a color other than black. Reviewed By: brecht Differential Revision: https://developer.blender.org/D454
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r--intern/cycles/render/nodes.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index 87affcbb49d..1d59b21d1c5 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -2419,6 +2419,7 @@ LightPathNode::LightPathNode()
add_output("Is Volume Scatter Ray", SHADER_SOCKET_FLOAT);
add_output("Ray Length", SHADER_SOCKET_FLOAT);
add_output("Ray Depth", SHADER_SOCKET_FLOAT);
+ add_output("Transparent Depth", SHADER_SOCKET_FLOAT);
}
void LightPathNode::compile(SVMCompiler& compiler)
@@ -2486,6 +2487,11 @@ void LightPathNode::compile(SVMCompiler& compiler)
compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_depth, out->stack_offset);
}
+ out = output("Transparent Depth");
+ if(!out->links.empty()) {
+ compiler.stack_assign(out);
+ compiler.add_node(NODE_LIGHT_PATH, NODE_LP_ray_transparent, out->stack_offset);
+ }
}
void LightPathNode::compile(OSLCompiler& compiler)