Fix #32904: strange pattern on subdivided cube with anistropic shader. Now

tangents from generated coordinates are computed per pixel on the fly, avoids
bad interpolation of singularities.
This commit is contained in:
Brecht Van Lommel
2012-10-17 23:09:12 +00:00
parent b2142d6533
commit 9d260eedeb
4 changed files with 37 additions and 77 deletions

View File

@@ -1246,8 +1246,10 @@ void WardBsdfNode::attributes(AttributeRequestSet *attributes)
{
ShaderInput *tangent_in = input("Tangent");
if(!tangent_in->link)
if(!tangent_in->link) {
attributes->add(ATTR_STD_TANGENT);
attributes->add(ATTR_STD_GENERATED);
}
ShaderNode::attributes(attributes);
}
@@ -1595,8 +1597,10 @@ GeometryNode::GeometryNode()
void GeometryNode::attributes(AttributeRequestSet *attributes)
{
if(!output("Tangent")->links.empty())
if(!output("Tangent")->links.empty()) {
attributes->add(ATTR_STD_TANGENT);
attributes->add(ATTR_STD_GENERATED);
}
ShaderNode::attributes(attributes);
}