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:
authorThomas Dinges <blender@dingto.org>2013-07-04 03:46:56 +0400
committerThomas Dinges <blender@dingto.org>2013-07-04 03:46:56 +0400
commit285ef99931447646b20ec968ec87f7c68939a104 (patch)
tree52c8b276b800baef886cf0867ad1a99554503ea2 /source/blender/nodes
parente7fc69bdfd06f9fda7ddbcf53f26fee0b81abf8d (diff)
Cycles:
* Added 2 new nodes to combine and separate HSV colors. Screenshot: http://www.pasteall.org/pic/show.php?id=54828
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/CMakeLists.txt1
-rw-r--r--source/blender/nodes/NOD_shader.h2
-rw-r--r--source/blender/nodes/NOD_static_types.h2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c80
4 files changed, 85 insertions, 0 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index 3241f98ad1e..64261246e3d 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -140,6 +140,7 @@ set(SRC
shader/nodes/node_shader_output.c
shader/nodes/node_shader_rgb.c
shader/nodes/node_shader_sepcombRGB.c
+ shader/nodes/node_shader_sepcombHSV.c
shader/nodes/node_shader_squeeze.c
shader/nodes/node_shader_texture.c
shader/nodes/node_shader_valToRgb.c
diff --git a/source/blender/nodes/NOD_shader.h b/source/blender/nodes/NOD_shader.h
index a8c77a9baed..ec39d81618d 100644
--- a/source/blender/nodes/NOD_shader.h
+++ b/source/blender/nodes/NOD_shader.h
@@ -70,6 +70,8 @@ void register_node_type_sh_material_ext(void);
void register_node_type_sh_invert(void);
void register_node_type_sh_seprgb(void);
void register_node_type_sh_combrgb(void);
+void register_node_type_sh_sephsv(void);
+void register_node_type_sh_combhsv(void);
void register_node_type_sh_hue_sat(void);
void register_node_type_sh_tex_brick(void);
diff --git a/source/blender/nodes/NOD_static_types.h b/source/blender/nodes/NOD_static_types.h
index f94e6fc9f52..05c1330ee85 100644
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@ -115,6 +115,8 @@ DefNode( ShaderNode, SH_NODE_TEX_CHECKER, def_sh_tex_checker, "TE
DefNode( ShaderNode, SH_NODE_TEX_BRICK, def_sh_tex_brick, "TEX_BRICK", TexBrick, "Brick Texture", "" )
DefNode( ShaderNode, SH_NODE_TEX_COORD, def_sh_tex_coord, "TEX_COORD", TexCoord, "Texture Coordinate","" )
DefNode( ShaderNode, SH_NODE_VECT_TRANSFORM, def_sh_vect_transform, "VECT_TRANSFORM", VectorTransform, "Vector Transform", "" )
+DefNode( ShaderNode, SH_NODE_SEPHSV, 0, "SEPHSV", SeparateHSV, "Separate HSV", "" )
+DefNode( ShaderNode, SH_NODE_COMBHSV, 0, "COMBHSV", CombineHSV, "Combine HSV", "" )
DefNode( CompositorNode, CMP_NODE_VIEWER, def_cmp_viewer, "VIEWER", Viewer, "Viewer", "" )
DefNode( CompositorNode, CMP_NODE_RGB, 0, "RGB", RGB, "RGB", "" )
diff --git a/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c b/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c
new file mode 100644
index 00000000000..707e295241a
--- /dev/null
+++ b/source/blender/nodes/shader/nodes/node_shader_sepcombHSV.c
@@ -0,0 +1,80 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2013 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/nodes/shader/nodes/node_shader_sepcombHSV.c
+ * \ingroup shdnodes
+ */
+
+
+#include "node_shader_util.h"
+
+/* **************** SEPARATE HSV ******************** */
+static bNodeSocketTemplate sh_node_sephsv_in[] = {
+ { SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f},
+ { -1, 0, "" }
+};
+static bNodeSocketTemplate sh_node_sephsv_out[] = {
+ { SOCK_FLOAT, 0, N_("H")},
+ { SOCK_FLOAT, 0, N_("S")},
+ { SOCK_FLOAT, 0, N_("V")},
+ { -1, 0, "" }
+};
+
+void register_node_type_sh_sephsv(void)
+{
+ static bNodeType ntype;
+
+ sh_node_type_base(&ntype, SH_NODE_SEPHSV, "Separate HSV", NODE_CLASS_CONVERTOR, 0);
+ node_type_compatibility(&ntype, NODE_NEW_SHADING);
+ node_type_socket_templates(&ntype, sh_node_sephsv_in, sh_node_sephsv_out);
+
+ nodeRegisterType(&ntype);
+}
+
+
+/* **************** COMBINE HSV ******************** */
+static bNodeSocketTemplate sh_node_combhsv_in[] = {
+ { SOCK_FLOAT, 1, N_("H"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED},
+ { SOCK_FLOAT, 1, N_("S"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED},
+ { SOCK_FLOAT, 1, N_("V"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_UNSIGNED},
+ { -1, 0, "" }
+};
+static bNodeSocketTemplate sh_node_combhsv_out[] = {
+ { SOCK_RGBA, 0, N_("Color")},
+ { -1, 0, "" }
+};
+
+void register_node_type_sh_combhsv(void)
+{
+ static bNodeType ntype;
+
+ sh_node_type_base(&ntype, SH_NODE_COMBHSV, "Combine HSV", NODE_CLASS_CONVERTOR, 0);
+ node_type_compatibility(&ntype, NODE_NEW_SHADING);
+ node_type_socket_templates(&ntype, sh_node_combhsv_in, sh_node_combhsv_out);
+
+ nodeRegisterType(&ntype);
+}