forked from bartvdbraak/blender
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:
parent
a9bb8d8a73
commit
3639a70eae
@ -2248,11 +2248,16 @@ void GeometryNode::compile(SVMCompiler& compiler)
|
|||||||
out = output("Pointiness");
|
out = output("Pointiness");
|
||||||
if(!out->links.empty()) {
|
if(!out->links.empty()) {
|
||||||
compiler.stack_assign(out);
|
compiler.stack_assign(out);
|
||||||
|
if(compiler.output_type() != SHADER_TYPE_VOLUME) {
|
||||||
compiler.add_node(attr_node,
|
compiler.add_node(attr_node,
|
||||||
ATTR_STD_POINTINESS,
|
ATTR_STD_POINTINESS,
|
||||||
out->stack_offset,
|
out->stack_offset,
|
||||||
NODE_ATTR_FLOAT);
|
NODE_ATTR_FLOAT);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
compiler.add_node(NODE_VALUE_F, __float_as_int(0.0f), out->stack_offset);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeometryNode::compile(OSLCompiler& compiler)
|
void GeometryNode::compile(OSLCompiler& compiler)
|
||||||
|
Loading…
Reference in New Issue
Block a user