Fix T44222: Crash using pointiness attribute for volume shaders

This attribute is not really supported for volumes, so it get's converted to
constant 0 at shader compile time.

TODO: We should consider doing the same for tangent attribute in order to save
some annoying checks at tracing time.
This commit is contained in:
Sergey Sharybin 2015-04-06 14:11:28 +05:00
parent a9bb8d8a73
commit 3639a70eae

@ -2248,11 +2248,16 @@ void GeometryNode::compile(SVMCompiler& compiler)
out = output("Pointiness");
if(!out->links.empty()) {
compiler.stack_assign(out);
if(compiler.output_type() != SHADER_TYPE_VOLUME) {
compiler.add_node(attr_node,
ATTR_STD_POINTINESS,
out->stack_offset,
NODE_ATTR_FLOAT);
}
else {
compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), out->stack_offset);
}
}
}
void GeometryNode::compile(OSLCompiler& compiler)