Fix T43651: New pointiness attribute doesn't work with displacement
Simple fix: just make pointiness aware of bump offset.
This commit is contained in:
@@ -60,5 +60,11 @@ shader node_geometry(
|
||||
}
|
||||
|
||||
getattribute("geom:pointiness", Pointiness);
|
||||
if (bump_offset == "dx") {
|
||||
Pointiness += Dx(Pointiness);
|
||||
}
|
||||
else if (bump_offset == "dy") {
|
||||
Pointiness += Dy(Pointiness);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2242,8 +2242,15 @@ void GeometryNode::compile(SVMCompiler& compiler)
|
||||
|
||||
out = output("Pointiness");
|
||||
if(!out->links.empty()) {
|
||||
NodeType attr_node = NODE_ATTR;
|
||||
if(bump == SHADER_BUMP_DX) {
|
||||
attr_node = NODE_ATTR_BUMP_DX;
|
||||
}
|
||||
else if(bump == SHADER_BUMP_DY) {
|
||||
attr_node = NODE_ATTR_BUMP_DY;
|
||||
}
|
||||
compiler.stack_assign(out);
|
||||
compiler.add_node(NODE_ATTR,
|
||||
compiler.add_node(attr_node,
|
||||
ATTR_STD_POINTINESS,
|
||||
out->stack_offset,
|
||||
NODE_ATTR_FLOAT);
|
||||
|
Reference in New Issue
Block a user