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
Notes: blender-bot 2023-02-14 09:17:55 +01:00
Referenced by issue #44222, Crash Rendering (Cycles/Cuda)
1 changed files with 9 additions and 4 deletions

View File

@ -2248,10 +2248,15 @@ void GeometryNode::compile(SVMCompiler& compiler)
out = output("Pointiness");
if(!out->links.empty()) {
compiler.stack_assign(out);
compiler.add_node(attr_node,
ATTR_STD_POINTINESS,
out->stack_offset,
NODE_ATTR_FLOAT);
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);
}
}
}