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:
authorCharlie Jolly <charlie>2022-08-30 13:05:46 +0300
committerCharlie Jolly <mistajolly@gmail.com>2022-08-31 02:13:57 +0300
commitbfa0ee13d5395fa2cf622b6808e93d0a7cd4f3ea (patch)
tree60a8fece4797903560d7892d6e388030a3566a2b /intern/cycles/scene/shader_nodes.h
parent0331a8c67c8035c29ac6b7655cb4e4d837ddabba (diff)
Node: Mix node
This patch is a response to T92588 and is implemented as a Function/Shader node. This node has support for Float, Vector and Color data types. For Vector it supports uniform and non-uniform mixing. For Color it now has the option to remove factor clamping. It replaces the Mix RGB for Shader and Geometry node trees. As discussed in T96219, this patch converts existing nodes in .blend files. The old node is still available in the Python API but hidden from the menus. Reviewed By: HooglyBoogly, JacquesLucke, simonthommes, brecht Maniphest Tasks: T92588 Differential Revision: https://developer.blender.org/D13749
Diffstat (limited to 'intern/cycles/scene/shader_nodes.h')
-rw-r--r--intern/cycles/scene/shader_nodes.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/intern/cycles/scene/shader_nodes.h b/intern/cycles/scene/shader_nodes.h
index ac40a397c1e..cc3a71a0697 100644
--- a/intern/cycles/scene/shader_nodes.h
+++ b/intern/cycles/scene/shader_nodes.h
@@ -1101,6 +1101,52 @@ class MixNode : public ShaderNode {
NODE_SOCKET_API(float, fac)
};
+class MixColorNode : public ShaderNode {
+ public:
+ SHADER_NODE_CLASS(MixColorNode)
+ void constant_fold(const ConstantFolder &folder);
+
+ NODE_SOCKET_API(float3, a)
+ NODE_SOCKET_API(float3, b)
+ NODE_SOCKET_API(float, fac)
+ NODE_SOCKET_API(bool, use_clamp)
+ NODE_SOCKET_API(bool, use_clamp_result)
+ NODE_SOCKET_API(NodeMix, blend_type)
+};
+
+class MixFloatNode : public ShaderNode {
+ public:
+ SHADER_NODE_CLASS(MixFloatNode)
+ void constant_fold(const ConstantFolder &folder);
+
+ NODE_SOCKET_API(float, a)
+ NODE_SOCKET_API(float, b)
+ NODE_SOCKET_API(float, fac)
+ NODE_SOCKET_API(bool, use_clamp)
+};
+
+class MixVectorNode : public ShaderNode {
+ public:
+ SHADER_NODE_CLASS(MixVectorNode)
+ void constant_fold(const ConstantFolder &folder);
+
+ NODE_SOCKET_API(float3, a)
+ NODE_SOCKET_API(float3, b)
+ NODE_SOCKET_API(float, fac)
+ NODE_SOCKET_API(bool, use_clamp)
+};
+
+class MixVectorNonUniformNode : public ShaderNode {
+ public:
+ SHADER_NODE_CLASS(MixVectorNonUniformNode)
+ void constant_fold(const ConstantFolder &folder);
+
+ NODE_SOCKET_API(float3, a)
+ NODE_SOCKET_API(float3, b)
+ NODE_SOCKET_API(float3, fac)
+ NODE_SOCKET_API(bool, use_clamp)
+};
+
class CombineColorNode : public ShaderNode {
public:
SHADER_NODE_CLASS(CombineColorNode)