[Bf-blender-cvs] [8f3d927] cycles_disney_brdf: Fixed the issue with artifacts when using anisotropy without linking the tangent input to a tangent node.
Pascal Schoen
noreply at git.blender.org
Wed Oct 26 09:07:47 CEST 2016
Commit: 8f3d92738532ad867a0a3543c00393626ab8f6ec
Author: Pascal Schoen
Date: Mon Oct 24 09:57:06 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rB8f3d92738532ad867a0a3543c00393626ab8f6ec
Fixed the issue with artifacts when using anisotropy without linking the
tangent input to a tangent node.
===================================================================
M intern/cycles/render/nodes.cpp
M intern/cycles/render/nodes.h
===================================================================
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp
index cefb1a1..848076c 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -2265,6 +2265,18 @@ DisneyBsdfNode::DisneyBsdfNode()
distribution_orig = NBUILTIN_CLOSURES;
}
+void DisneyBsdfNode::attributes(Shader *shader, AttributeRequestSet *attributes)
+{
+ if(shader->has_surface) {
+ ShaderInput *tangent_in = input("Tangent");
+
+ if(!tangent_in->link)
+ attributes->add(ATTR_STD_GENERATED);
+ }
+
+ ShaderNode::attributes(shader, attributes);
+}
+
void DisneyBsdfNode::compile(SVMCompiler& compiler, ShaderInput *p_metallic, ShaderInput *p_subsurface, ShaderInput *p_subsurface_radius,
ShaderInput *p_specular, ShaderInput *p_roughness, ShaderInput *p_specular_tint, ShaderInput *p_anisotropic,
ShaderInput *p_sheen, ShaderInput *p_sheen_tint, ShaderInput *p_clearcoat, ShaderInput *p_clearcoat_gloss,
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index dd43d8c..c3e9314 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -391,6 +391,7 @@ public:
ClosureType get_closure_type() { return closure; }
bool has_integrator_dependency();
+ void attributes(Shader *shader, AttributeRequestSet *attributes);
};
class TranslucentBsdfNode : public BsdfNode {
More information about the Bf-blender-cvs
mailing list