Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-04-21 13:50:04 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-04-21 15:36:56 +0300
commitb6da2a6a86fb948f11f9147c5ed722a064673e6d (patch)
tree0a93da437c4189cb76483ba09d4f245c81da937e /intern/cycles/render/nodes.h
parente4ab70da862b5852a6e3f7bab489bed8c3b18193 (diff)
Cycles: Make it a generic base class for all types of closure nodes
The idea is to have osme geenric BSDF node which is subclassed by "regular" BSDF nodes and uber shaders. This way we can access special type and closure type for making decisions somewhere else.
Diffstat (limited to 'intern/cycles/render/nodes.h')
-rw-r--r--intern/cycles/render/nodes.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/intern/cycles/render/nodes.h b/intern/cycles/render/nodes.h
index bc488161e3b..a56313bd5d4 100644
--- a/intern/cycles/render/nodes.h
+++ b/intern/cycles/render/nodes.h
@@ -321,7 +321,14 @@ private:
static bool initialized;
};
-class BsdfNode : public ShaderNode {
+class BsdfBaseNode : public ShaderNode {
+public:
+ BsdfBaseNode(const NodeType *node_type);
+
+ ClosureType closure;
+};
+
+class BsdfNode : public BsdfBaseNode {
public:
explicit BsdfNode(const NodeType *node_type);
SHADER_NODE_BASE_CLASS(BsdfNode)
@@ -333,7 +340,6 @@ public:
float3 color;
float3 normal;
float surface_mix_weight;
- ClosureType closure;
virtual bool equals(const ShaderNode& /*other*/)
{
@@ -362,7 +368,7 @@ public:
};
/* Disney principled BRDF */
-class PrincipledBsdfNode : public ShaderNode {
+class PrincipledBsdfNode : public BsdfBaseNode {
public:
SHADER_NODE_CLASS(PrincipledBsdfNode)
@@ -381,7 +387,7 @@ public:
anisotropic_rotation, refraction_roughness;
float3 normal, clearcoat_normal, tangent;
float surface_mix_weight;
- ClosureType closure, distribution, distribution_orig;
+ ClosureType distribution, distribution_orig;
virtual bool equals(const ShaderNode * /*other*/)
{