30 b.add_input<
decl::Color>(
"Color").default_value({0.8f, 0.8f, 0.8f, 1.0f});
46 return "separate_color_rgb";
48 return "separate_color_hsv";
50 return "separate_color_hsl";
64 if (name !=
nullptr) {
75 NodeItem color = get_input_value(
"Color", NodeItem::Type::Color3);
77 NodeItem convert = empty();
85 convert = create_node(
"rgbtohsv", NodeItem::Type::Color3, {{
"in", color}});
91 int index =
STREQ(socket_out_->name,
"Red") ? 0 :
STREQ(socket_out_->name,
"Green") ? 1 : 2;
106 ntype.
declare = file_ns::sh_node_sepcolor_declare;
107 ntype.
updatefunc = file_ns::node_sepcolor_update;
111 ntype.
gpu_fn = file_ns::gpu_shader_sepcolor;
141 return "combine_color_rgb";
143 return "combine_color_hsv";
145 return "combine_color_hsl";
159 if (name !=
nullptr) {
170 NodeItem
red = get_input_value(
"Red", NodeItem::Type::Float);
171 NodeItem green = get_input_value(
"Green", NodeItem::Type::Float);
172 NodeItem blue = get_input_value(
"Blue", NodeItem::Type::Float);
174 NodeItem combine = create_node(
"combine3", NodeItem::Type::Color3);
175 combine.set_input(
"in1",
red);
176 combine.set_input(
"in2", green);
177 combine.set_input(
"in3", blue);
179 NodeItem res = empty();
187 res = create_node(
"hsvtorgb", NodeItem::Type::Color3);
188 res.set_input(
"in", combine);
207 ntype.
declare = file_ns::sh_node_combcolor_declare;
208 ntype.
updatefunc = file_ns::node_combcolor_update;
212 ntype.
gpu_fn = file_ns::gpu_shader_combcolor;
#define SH_NODE_COMBINE_COLOR
#define NODE_CLASS_CONVERTER
#define NODE_STORAGE_FUNCS(StorageT)
#define SH_NODE_SEPARATE_COLOR
#define BLI_assert_unreachable()
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Brightness Control the brightness and contrast of the input color Vector Map input vector components with curves Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert Invert a producing a negative Combine Generate a color from its red
local_group_size(16, 16) .push_constant(Type b
void node_type_storage(bNodeType *ntype, const char *storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
void node_register_type(bNodeType *ntype)
void convert(SignedNormalized< StorageType > &dst, const F32 &src)
static void node_combcolor_update(bNodeTree *, bNode *node)
static void sh_node_combcolor_declare(NodeDeclarationBuilder &b)
static int gpu_shader_combcolor(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static const char * gpu_shader_get_name(int mode)
static const char * gpu_shader_get_name(int mode)
static void node_sepcolor_update(bNodeTree *, bNode *node)
static int gpu_shader_sepcolor(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void sh_node_sepcolor_declare(NodeDeclarationBuilder &b)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_sepcolor()
static void node_combsep_color_init(bNodeTree *, bNode *node)
void register_node_type_sh_combcolor()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
void node_free_standard_storage(bNode *node)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode)
NodeMaterialXFunction materialx_fn
void(* initfunc)(bNodeTree *ntree, bNode *node)
NodeGPUExecFunction gpu_fn
NodeDeclareFunction declare
void(* updatefunc)(bNodeTree *ntree, bNode *node)