[Bf-blender-cvs] [49f03030e3d] principled-v2: Cleanup: Get rid of unneccessary override in the Principled BSDF node

Lukas Stockner noreply at git.blender.org
Mon Jul 4 23:56:13 CEST 2022


Commit: 49f03030e3dde03991c68fdf878a2a4e86a9dc60
Author: Lukas Stockner
Date:   Mon Jul 4 23:31:47 2022 +0200
Branches: principled-v2
https://developer.blender.org/rB49f03030e3dde03991c68fdf878a2a4e86a9dc60

Cleanup: Get rid of unneccessary override in the Principled BSDF node

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

M	intern/cycles/scene/shader_nodes.cpp
M	intern/cycles/scene/shader_nodes.h

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

diff --git a/intern/cycles/scene/shader_nodes.cpp b/intern/cycles/scene/shader_nodes.cpp
index d9f406b5194..e98c5e9edb4 100644
--- a/intern/cycles/scene/shader_nodes.cpp
+++ b/intern/cycles/scene/shader_nodes.cpp
@@ -2853,27 +2853,27 @@ void PrincipledBsdfNode::attributes(Shader *shader, AttributeRequestSet *attribu
   ShaderNode::attributes(shader, attributes);
 }
 
-void PrincipledBsdfNode::compile(SVMCompiler &compiler,
-                                 ShaderInput *p_metallic,
-                                 ShaderInput *p_subsurface,
-                                 ShaderInput *p_subsurface_radius,
-                                 ShaderInput *p_subsurface_ior,
-                                 ShaderInput *p_subsurface_anisotropy,
-                                 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_roughness,
-                                 ShaderInput *p_ior,
-                                 ShaderInput *p_transmission,
-                                 ShaderInput *p_anisotropic_rotation,
-                                 ShaderInput *p_transmission_roughness)
+void PrincipledBsdfNode::compile(SVMCompiler &compiler)
 {
   ShaderInput *base_color_in = input("Base Color");
   ShaderInput *subsurface_color_in = input("Subsurface Color");
+  ShaderInput *p_metallic = input("Metallic");
+  ShaderInput *p_subsurface = input("Subsurface");
+  ShaderInput *p_subsurface_radius = input("Subsurface Radius");
+  ShaderInput *p_subsurface_ior = input("Subsurface IOR");
+  ShaderInput *p_subsurface_anisotropy = input("Subsurface Anisotropy");
+  ShaderInput *p_specular = input("Specular");
+  ShaderInput *p_roughness = input("Roughness");
+  ShaderInput *p_specular_tint = input("Specular Tint");
+  ShaderInput *p_anisotropic = input("Anisotropic");
+  ShaderInput *p_sheen = input("Sheen");
+  ShaderInput *p_sheen_tint = input("Sheen Tint");
+  ShaderInput *p_clearcoat = input("Clearcoat");
+  ShaderInput *p_clearcoat_roughness = input("Clearcoat Roughness");
+  ShaderInput *p_ior = input("IOR");
+  ShaderInput *p_transmission = input("Transmission");
+  ShaderInput *p_anisotropic_rotation = input("Anisotropic Rotation");
+  ShaderInput *p_transmission_roughness = input("Transmission Roughness");
   ShaderInput *normal_in = input("Normal");
   ShaderInput *clearcoat_normal_in = input("Clearcoat Normal");
   ShaderInput *tangent_in = input("Tangent");
@@ -2953,28 +2953,6 @@ bool PrincipledBsdfNode::has_integrator_dependency()
   return !roughness_input->link && roughness <= 1e-4f;
 }
 
-void PrincipledBsdfNode::compile(SVMCompiler &compiler)
-{
-  compile(compiler,
-          input("Metallic"),
-          input("Subsurface"),
-          input("Subsurface Radius"),
-          input("Subsurface IOR"),
-          input("Subsurface Anisotropy"),
-          input("Specular"),
-          input("Roughness"),
-          input("Specular Tint"),
-          input("Anisotropic"),
-          input("Sheen"),
-          input("Sheen Tint"),
-          input("Clearcoat"),
-          input("Clearcoat Roughness"),
-          input("IOR"),
-          input("Transmission"),
-          input("Anisotropic Rotation"),
-          input("Transmission Roughness"));
-}
-
 void PrincipledBsdfNode::compile(OSLCompiler &compiler)
 {
   compiler.parameter(this, "distribution");
diff --git a/intern/cycles/scene/shader_nodes.h b/intern/cycles/scene/shader_nodes.h
index ac40a397c1e..28fc49b3c01 100644
--- a/intern/cycles/scene/shader_nodes.h
+++ b/intern/cycles/scene/shader_nodes.h
@@ -529,24 +529,6 @@ class PrincipledBsdfNode : public BsdfBaseNode {
   void expand(ShaderGraph *graph);
   bool has_surface_bssrdf();
   bool has_bssrdf_bump();
-  void compile(SVMCompiler &compiler,
-               ShaderInput *metallic,
-               ShaderInput *subsurface,
-               ShaderInput *subsurface_radius,
-               ShaderInput *subsurface_ior,
-               ShaderInput *subsurface_anisotropy,
-               ShaderInput *specular,
-               ShaderInput *roughness,
-               ShaderInput *specular_tint,
-               ShaderInput *anisotropic,
-               ShaderInput *sheen,
-               ShaderInput *sheen_tint,
-               ShaderInput *clearcoat,
-               ShaderInput *clearcoat_roughness,
-               ShaderInput *ior,
-               ShaderInput *transmission,
-               ShaderInput *anisotropic_rotation,
-               ShaderInput *transmission_roughness);
 
   NODE_SOCKET_API(float3, base_color)
   NODE_SOCKET_API(float3, subsurface_color)



More information about the Bf-blender-cvs mailing list