Only add normal attributes for elliptical hairs

This commit is contained in:
Weizhen Huang 2022-12-27 13:52:25 +01:00
parent 8bad526d51
commit 767eb3cd6a
1 changed files with 4 additions and 1 deletions

View File

@ -3698,7 +3698,10 @@ MicrofacetHairBsdfNode::MicrofacetHairBsdfNode() : BsdfBaseNode(get_node_type())
void MicrofacetHairBsdfNode::attributes(Shader *shader, AttributeRequestSet *attributes)
{
/* Make sure we have the normal for elliptical cross section tracking */
attributes->add(ATTR_STD_VERTEX_NORMAL);
if (model_type == NODE_MICROFACET_HAIR_ELLIPTIC_BECKMANN ||
model_type == NODE_MICROFACET_HAIR_ELLIPTIC_GGX) {
attributes->add(ATTR_STD_VERTEX_NORMAL);
}
if (!input("Random")->link) {
attributes->add(ATTR_STD_CURVE_RANDOM);