[Bf-blender-cvs] [f91a286] cycles_disney_brdf: removed BsdfNode class inheritance for DisneyBsdfNode
Pascal Schoen
noreply at git.blender.org
Mon May 30 09:08:59 CEST 2016
Commit: f91a28639884cbda7804715b910d64abba0718ef
Author: Pascal Schoen
Date: Tue May 17 10:40:48 2016 +0200
Branches: cycles_disney_brdf
https://developer.blender.org/rBf91a28639884cbda7804715b910d64abba0718ef
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 f54b61d..9a0a917 100644
--- a/intern/cycles/render/nodes.cpp
+++ b/intern/cycles/render/nodes.cpp
@@ -2109,7 +2109,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));
@@ -2123,7 +2125,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 626c880..4dbffa2 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -415,9 +415,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