Blender V4.3
node_composite_sepcomb_xyz.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "GPU_material.hh"
10
11#include "COM_shader_node.hh"
12
14
15/* **************** SEPARATE XYZ ******************** */
16
18
20{
21 b.add_input<decl::Vector>("Vector").min(-10000.0f).max(10000.0f);
22 b.add_output<decl::Float>("X");
23 b.add_output<decl::Float>("Y");
24 b.add_output<decl::Float>("Z");
25}
26
27using namespace blender::realtime_compositor;
28
30 public:
32
33 void compile(GPUMaterial *material) override
34 {
37
38 GPU_stack_link(material, &bnode(), "node_composite_separate_xyz", inputs, outputs);
39 }
40};
41
43{
44 return new SeparateXYZShaderNode(node);
45}
46
47} // namespace blender::nodes::node_composite_separate_xyz_cc
48
50{
52
53 static blender::bke::bNodeType ntype;
54
55 cmp_node_type_base(&ntype, CMP_NODE_SEPARATE_XYZ, "Separate XYZ", NODE_CLASS_CONVERTER);
56 ntype.declare = file_ns::cmp_node_separate_xyz_declare;
57 ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
58
60}
61
62/* **************** COMBINE XYZ ******************** */
63
65
67{
68 b.add_input<decl::Float>("X").min(-10000.0f).max(10000.0f);
69 b.add_input<decl::Float>("Y").min(-10000.0f).max(10000.0f);
70 b.add_input<decl::Float>("Z").min(-10000.0f).max(10000.0f);
71 b.add_output<decl::Vector>("Vector");
72}
73
74using namespace blender::realtime_compositor;
75
77 public:
79
80 void compile(GPUMaterial *material) override
81 {
84
85 GPU_stack_link(material, &bnode(), "node_composite_combine_xyz", inputs, outputs);
86 }
87};
88
90{
91 return new CombineXYZShaderNode(node);
92}
93
94} // namespace blender::nodes::node_composite_combine_xyz_cc
95
97{
99
100 static blender::bke::bNodeType ntype;
101
102 cmp_node_type_base(&ntype, CMP_NODE_COMBINE_XYZ, "Combine XYZ", NODE_CLASS_CONVERTER);
103 ntype.declare = file_ns::cmp_node_combine_xyz_declare;
104 ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
105
107}
#define NODE_CLASS_CONVERTER
Definition BKE_node.hh:410
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void cmp_node_combine_xyz_declare(NodeDeclarationBuilder &b)
static void cmp_node_separate_xyz_declare(NodeDeclarationBuilder &b)
void register_node_type_cmp_separate_xyz()
void register_node_type_cmp_combine_xyz()
void cmp_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
#define min(a, b)
Definition sort.c:32
Defines a node type.
Definition BKE_node.hh:218
NodeDeclareFunction declare
Definition BKE_node.hh:347
NodeGetCompositorShaderNodeFunction get_compositor_shader_node
Definition BKE_node.hh:328