Blender  V3.3
node_shader_sepcomb_hsv.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2013 Blender Foundation. All rights reserved. */
3 
8 #include "node_shader_util.hh"
9 
11 
12 /* **************** SEPARATE HSV ******************** */
13 
15 {
16  b.add_input<decl::Color>(N_("Color")).default_value({0.8f, 0.8f, 0.8f, 1.0});
17  b.add_output<decl::Float>(N_("H"));
18  b.add_output<decl::Float>(N_("S"));
19  b.add_output<decl::Float>(N_("V"));
20 }
21 
23  bNode *node,
24  bNodeExecData *UNUSED(execdata),
25  GPUNodeStack *in,
27 {
28  return GPU_stack_link(mat, node, "separate_hsv", in, out);
29 }
30 
31 } // namespace blender::nodes::node_shader_sepcomb_hsv_cc
32 
34 {
36 
37  static bNodeType ntype;
38 
42  ntype.gather_link_search_ops = nullptr;
43 
44  nodeRegisterType(&ntype);
45 }
46 
48 
49 /* **************** COMBINE HSV ******************** */
50 
52 {
53  b.add_input<decl::Float>(N_("H")).default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
54  b.add_input<decl::Float>(N_("S")).default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
55  b.add_input<decl::Float>(N_("V")).default_value(0.0f).min(0.0f).max(1.0f).subtype(PROP_UNSIGNED);
56  b.add_output<decl::Color>(N_("Color"));
57 }
58 
60  bNode *node,
61  bNodeExecData *UNUSED(execdata),
62  GPUNodeStack *in,
64 {
65  return GPU_stack_link(mat, node, "combine_hsv", in, out);
66 }
67 
68 } // namespace blender::nodes::node_shader_sepcomb_hsv_cc
69 
71 {
73 
74  static bNodeType ntype;
75 
79  ntype.gather_link_search_ops = nullptr;
80 
81  nodeRegisterType(&ntype);
82 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
#define NODE_CLASS_CONVERTER
Definition: BKE_node.h:351
#define SH_NODE_SEPHSV_LEGACY
Definition: BKE_node.h:1154
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between and object coordinate space SH_NODE_COMBHSV_LEGACY
@ PROP_UNSIGNED
Definition: RNA_types.h:142
OperationNode * node
static int gpu_shader_combhsv(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static void node_declare_sephsv(NodeDeclarationBuilder &b)
static void node_declare_combhsv(NodeDeclarationBuilder &b)
static int gpu_shader_sephsv(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_sh_sephsv()
void register_node_type_sh_combhsv()
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition: BKE_node.h:226
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition: BKE_node.h:335
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)