Cycles: Set default closure values to some of the nodes
authorSergey Sharybin <sergey.vfx@gmail.com>
Sat, 9 May 2015 13:53:57 +0000 (18:53 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sat, 9 May 2015 14:04:09 +0000 (19:04 +0500)
Previously it was only set at compilation time which is all fine but does
not let us to check which closure the node corresponds to prior to the
compilation.

intern/cycles/render/nodes.cpp

index d17d531aa77eb712aea1ac0700b67a5451cf2c94..d3f26a08292af038c222868e1c051c9dc5d3d23c 100644 (file)
@@ -1609,6 +1609,7 @@ ShaderEnum AnisotropicBsdfNode::distribution_enum = aniso_distribution_init();
 
 AnisotropicBsdfNode::AnisotropicBsdfNode()
 {
+       closure = CLOSURE_BSDF_MICROFACET_GGX_ANISO_ID;
        distribution = ustring("GGX");
 
        add_input("Tangent", SHADER_SOCKET_VECTOR, ShaderInput::TANGENT);
@@ -1661,6 +1662,7 @@ ShaderEnum GlossyBsdfNode::distribution_enum = glossy_distribution_init();
 
 GlossyBsdfNode::GlossyBsdfNode()
 {
+       closure = CLOSURE_BSDF_MICROFACET_GGX_ID;
        distribution = ustring("GGX");
 
        add_input("Roughness", SHADER_SOCKET_FLOAT, 0.2f);
@@ -1699,6 +1701,7 @@ ShaderEnum GlassBsdfNode::distribution_enum = glass_distribution_init();
 
 GlassBsdfNode::GlassBsdfNode()
 {
+       closure = CLOSURE_BSDF_SHARP_GLASS_ID;
        distribution = ustring("Sharp");
 
        add_input("Roughness", SHADER_SOCKET_FLOAT, 0.0f);
@@ -1738,6 +1741,7 @@ ShaderEnum RefractionBsdfNode::distribution_enum = refraction_distribution_init(
 
 RefractionBsdfNode::RefractionBsdfNode()
 {
+       closure = CLOSURE_BSDF_REFRACTION_ID;
        distribution = ustring("Sharp");
 
        add_input("Roughness", SHADER_SOCKET_FLOAT, 0.0f);
@@ -1776,6 +1780,7 @@ ShaderEnum ToonBsdfNode::component_enum = toon_component_init();
 
 ToonBsdfNode::ToonBsdfNode()
 {
+       closure = CLOSURE_BSDF_DIFFUSE_TOON_ID;
        component = ustring("Diffuse");
 
        add_input("Size", SHADER_SOCKET_FLOAT, 0.5f);
@@ -2135,6 +2140,7 @@ ShaderEnum HairBsdfNode::component_enum = hair_component_init();
 
 HairBsdfNode::HairBsdfNode()
 {
+       closure = CLOSURE_BSDF_HAIR_REFLECTION_ID;
        component = ustring("Reflection");
 
        add_input("Offset", SHADER_SOCKET_FLOAT);