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.
This commit is contained in:
2016-05-17 10:40:48 +02:00
parent 30da91c9c5
commit f91a286398
2 changed files with 15 additions and 1 deletions

View File

@@ -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)

View File

@@ -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 {