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
This commit is contained in:
Carlo Andreacchio
2014-04-21 14:20:29 +02:00
committed by Brecht Van Lommel
parent f8cd3d974d
commit 7765b73f6d
14 changed files with 66 additions and 37 deletions

View File

@@ -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)