diff options
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index c572cdde75d..aaf8d1d09d3 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -2400,13 +2400,18 @@ GeometryNode::GeometryNode() add_output("Incoming", SHADER_SOCKET_VECTOR); add_output("Parametric", SHADER_SOCKET_POINT); add_output("Backfacing", SHADER_SOCKET_FLOAT); + add_output("Pointiness", SHADER_SOCKET_FLOAT); } void GeometryNode::attributes(Shader *shader, AttributeRequestSet *attributes) { if(shader->has_surface) { - if(!output("Tangent")->links.empty()) + if(!output("Tangent")->links.empty()) { attributes->add(ATTR_STD_GENERATED); + } + if(!output("Pointiness")->links.empty()) { + attributes->add(ATTR_STD_POINTINESS); + } } ShaderNode::attributes(shader, attributes); @@ -2463,6 +2468,15 @@ void GeometryNode::compile(SVMCompiler& compiler) compiler.stack_assign(out); compiler.add_node(NODE_LIGHT_PATH, NODE_LP_backfacing, out->stack_offset); } + + out = output("Pointiness"); + if(!out->links.empty()) { + compiler.stack_assign(out); + compiler.add_node(NODE_ATTR, + ATTR_STD_POINTINESS, + out->stack_offset, + NODE_ATTR_FLOAT); + } } void GeometryNode::compile(OSLCompiler& compiler) |