Blender V4.5
node_shader_sepcomb_hsv.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "node_shader_util.hh"
10
12
13/* **************** SEPARATE HSV ******************** */
14
16{
17 b.add_input<decl::Color>("Color").default_value({0.8f, 0.8f, 0.8f, 1.0});
18 b.add_output<decl::Float>("H");
19 b.add_output<decl::Float>("S");
20 b.add_output<decl::Float>("V");
21}
22
24 bNode *node,
25 bNodeExecData * /*execdata*/,
28{
29 return GPU_stack_link(mat, node, "separate_hsv", in, out);
30}
31
32} // namespace blender::nodes::node_shader_sepcomb_hsv_cc
33
35{
37
38 static blender::bke::bNodeType ntype;
39
40 sh_node_type_base(&ntype, "ShaderNodeSeparateHSV", SH_NODE_SEPHSV_LEGACY);
41 ntype.ui_name = "Separate HSV (Legacy)";
42 ntype.ui_description = "Deprecated";
43 ntype.enum_name_legacy = "SEPHSV";
45 ntype.declare = file_ns::node_declare_sephsv;
46 ntype.gpu_fn = file_ns::gpu_shader_sephsv;
47 ntype.gather_link_search_ops = nullptr;
48
50}
51
53
54/* **************** COMBINE HSV ******************** */
55
57{
58 b.add_input<decl::Float>("H").default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
59 b.add_input<decl::Float>("S").default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
60 b.add_input<decl::Float>("V").default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
61 b.add_output<decl::Color>("Color");
62}
63
65 bNode *node,
66 bNodeExecData * /*execdata*/,
69{
70 return GPU_stack_link(mat, node, "combine_hsv", in, out);
71}
72
73} // namespace blender::nodes::node_shader_sepcomb_hsv_cc
74
76{
78
79 static blender::bke::bNodeType ntype;
80
81 sh_node_type_base(&ntype, "ShaderNodeCombineHSV", SH_NODE_COMBHSV_LEGACY);
82 ntype.ui_name = "Combine HSV (Legacy)";
83 ntype.ui_description = "Deprecated";
84 ntype.enum_name_legacy = "COMBHSV";
86 ntype.declare = file_ns::node_declare_combhsv;
87 ntype.gpu_fn = file_ns::gpu_shader_combhsv;
88 ntype.gather_link_search_ops = nullptr;
89
91}
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:439
#define SH_NODE_SEPHSV_LEGACY
#define SH_NODE_COMBHSV_LEGACY
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ PROP_UNSIGNED
Definition RNA_types.hh:237
#define in
#define out
void node_register_type(bNodeType &ntype)
Definition node.cc:2748
static int gpu_shader_sephsv(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare_sephsv(NodeDeclarationBuilder &b)
static void node_declare_combhsv(NodeDeclarationBuilder &b)
static int gpu_shader_combhsv(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
void register_node_type_sh_sephsv()
void register_node_type_sh_combhsv()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:226
std::string ui_description
Definition BKE_node.hh:232
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:330
const char * enum_name_legacy
Definition BKE_node.hh:235
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition BKE_node.hh:371
NodeDeclareFunction declare
Definition BKE_node.hh:355