Blender  V3.3
node_shader_rgb.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
8 #include "node_shader_util.hh"
9 
11 
13 {
14  b.add_output<decl::Color>(N_("Color")).default_value({0.5f, 0.5f, 0.5f, 1.0f});
15 }
16 
17 static int gpu_shader_rgb(GPUMaterial *mat,
18  bNode *node,
19  bNodeExecData *UNUSED(execdata),
20  GPUNodeStack *in,
22 {
23  GPUNodeLink *link = GPU_uniformbuf_link_out(mat, node, out, 0);
24  return GPU_stack_link(mat, node, "set_rgba", in, out, link);
25 }
26 
27 } // namespace blender::nodes::node_shader_rgb_cc
28 
30 {
31  namespace file_ns = blender::nodes::node_shader_rgb_cc;
32 
33  static bNodeType ntype;
34 
38 
39  nodeRegisterType(&ntype);
40 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
#define NODE_CLASS_INPUT
Definition: BKE_node.h:345
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
GPUNodeLink * GPU_uniformbuf_link_out(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *stack, int index)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
Group Output data from inside of a node group SH_NODE_RGB
OperationNode * node
static void node_declare(NodeDeclarationBuilder &b)
static int gpu_shader_rgb(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_rgb()
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition: BKE_node.h:226
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)