[Bf-blender-cvs] [419ee54] cycles_disney_brdf: removed BsdfNode class inheritance for DisneyBsdfNode

Pascal Schoen noreply at git.blender.org
Tue May 17 10:46:53 CEST 2016


Commit: 419ee5441100a906b4b3fd8373cb768a71bfdfe6
Author: Pascal Schoen
Date:   Tue May 17 10:40:48 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rB419ee5441100a906b4b3fd8373cb768a71bfdfe6

removed BsdfNode class inheritance for DisneyBsdfNode

That's due to a naming difference. The Disney BSDF uses the name 'Base Color'
while the BsdfNode had a 'Color' input. That caused a text message to be
printed while rendering.

===================================================================

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 bcf4e67..965d51c 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -2069,7 +2069,9 @@ void DiffuseBsdfNode::compile(OSLCompiler& compiler)
 
 /* Disney BSDF Closure */
 DisneyBsdfNode::DisneyBsdfNode()
+	: ShaderNode("bsdf")
 {
+	special_type = SHADER_SPECIAL_TYPE_CLOSURE;
 	closure = CLOSURE_BSDF_DISNEY_DIFFUSE_ID;
 
 	add_input("BaseColor", SHADER_SOCKET_COLOR, make_float3(0.646f, 0.415f, 0.017f));
@@ -2083,7 +2085,9 @@ DisneyBsdfNode::DisneyBsdfNode()
 	add_input("SheenTint", SHADER_SOCKET_FLOAT, 0.5f);
 	add_input("Clearcoat", SHADER_SOCKET_FLOAT, 0.0f);
 	add_input("ClearcoatGloss", SHADER_SOCKET_FLOAT, 1.0f);
+	add_input("Normal", SHADER_SOCKET_NORMAL, ShaderInput::NORMAL);
 	add_input("Tangent", SHADER_SOCKET_VECTOR, ShaderInput::TANGENT);
+	add_input("SurfaceMixWeight", SHADER_SOCKET_FLOAT, 0.0f, ShaderInput::USE_SVM);
 }
 
 void DisneyBsdfNode::compile(SVMCompiler& compiler)
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index c44bf20..5a256bf 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -411,9 +411,19 @@ public:
 };
 
 /* Disney BRDF */
-class DisneyBsdfNode : public BsdfNode {
+class DisneyBsdfNode : public ShaderNode {
 public:
 	SHADER_NODE_CLASS(DisneyBsdfNode)
+
+	bool has_spatial_varying() { return true; }
+
+	ClosureType closure;
+
+	virtual bool equals(const ShaderNode * /*other*/)
+	{
+		/* TODO(sergey): With some care BSDF nodes can be de-duplicated. */
+		return false;
+	}
 };
 
 class TranslucentBsdfNode : public BsdfNode {




More information about the Bf-blender-cvs mailing list