Blender V4.3
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
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*/,
26 GPUNodeStack *in,
27 GPUNodeStack *out)
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, SH_NODE_SEPHSV_LEGACY, "Separate HSV (Legacy)", NODE_CLASS_CONVERTER);
41 ntype.declare = file_ns::node_declare_sephsv;
42 ntype.gpu_fn = file_ns::gpu_shader_sephsv;
43 ntype.gather_link_search_ops = nullptr;
44
46}
47
49
50/* **************** COMBINE HSV ******************** */
51
53{
54 b.add_input<decl::Float>("H").default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
55 b.add_input<decl::Float>("S").default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
56 b.add_input<decl::Float>("V").default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
57 b.add_output<decl::Color>("Color");
58}
59
61 bNode *node,
62 bNodeExecData * /*execdata*/,
63 GPUNodeStack *in,
64 GPUNodeStack *out)
65{
66 return GPU_stack_link(mat, node, "combine_hsv", in, out);
67}
68
69} // namespace blender::nodes::node_shader_sepcomb_hsv_cc
70
72{
74
75 static blender::bke::bNodeType ntype;
76
77 sh_node_type_base(&ntype, SH_NODE_COMBHSV_LEGACY, "Combine HSV (Legacy)", NODE_CLASS_CONVERTER);
78 ntype.declare = file_ns::node_declare_combhsv;
79 ntype.gpu_fn = file_ns::gpu_shader_combhsv;
80 ntype.gather_link_search_ops = nullptr;
81
83}
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:410
#define SH_NODE_SEPHSV_LEGACY
Definition BKE_node.hh:966
#define SH_NODE_COMBHSV_LEGACY
Definition BKE_node.hh:967
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ PROP_UNSIGNED
Definition RNA_types.hh:152
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
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, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:318
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition BKE_node.hh:363
NodeDeclareFunction declare
Definition BKE_node.hh:347