Blender V5.3
node_shader_light_iter_internal.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2026 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#include "node_shader_util.hh"
10
11namespace blender {
12
14
16
18{
19 b.add_output<decl::Int>("LightIndex"_ustr);
20}
21
23 bNode *node,
24 bNodeExecData * /*execdata*/,
27{
28 int zone_id = *reinterpret_cast<int *>(&node->custom3);
29 return GPU_stack_link_zone(mat, node, "LIGHT_ITER_BEGIN", in, out, zone_id, false, 0, 1);
30}
31
32} // namespace light_iter_input_node
33
35
36static void node_declare(NodeDeclarationBuilder & /*b*/) {}
37
39 bNode *node,
40 bNodeExecData * /*execdata*/,
43{
44 int zone_id = node->identifier;
45 return GPU_stack_link_zone(mat, node, "LIGHT_ITER_END", in, out, zone_id, true, 0, 0);
46}
47
48} // namespace light_iter_output_node
49
50namespace {
51bool add_ui_poll(const bContext * /*C*/)
52{
53 /* This node is for internal use only. */
54 return false;
55}
56} // namespace
57
58} // namespace nodes::node_shader_light_iter_internal_cc
59
61{
63
64 static bke::bNodeType ntype;
65
67 &ntype, "ShaderNodeLightIterInternalInput"_ustr, SH_NODE_LIGHT_ITER_INTERNAL_INPUT);
68 ntype.ui_name = "Light Iter Internal Input";
69 ntype.ui_description = "Light Iter Internal Input";
70 ntype.enum_name_legacy = "LIGHT_ITER_INTERNAL_INPUT";
72 ntype.declare = file_ns::node_declare;
74 ntype.gpu_fn = file_ns::node_shader_fn;
75 ntype.add_ui_poll = nodes::node_shader_light_iter_internal_cc::add_ui_poll;
76
78}
79
81{
83
84 static bke::bNodeType ntype;
85
87 &ntype, "ShaderNodeLightIterInternalOutput"_ustr, SH_NODE_LIGHT_ITER_INTERNAL_OUTPUT);
88 ntype.ui_name = "Light Iter Internal Output";
89 ntype.ui_description = "Light Iter Internal Output";
90 ntype.enum_name_legacy = "LIGHT_ITER_INTERNAL_OUTPUT";
92 ntype.declare = file_ns::node_declare;
94 ntype.gpu_fn = file_ns::node_shader_fn;
95 ntype.add_ui_poll = nodes::node_shader_light_iter_internal_cc::add_ui_poll;
96
98}
99
100} // namespace blender
#define NODE_CLASS_SHADER
Definition BKE_node.hh:491
#define SH_NODE_LIGHT_ITER_INTERNAL_OUTPUT
#define SH_NODE_LIGHT_ITER_INTERNAL_INPUT
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static int node_shader_fn(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static int node_shader_fn(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
BMesh Iterators.
void register_node_type_sh_light_iter_internal_input()
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool GPU_stack_link_zone(GPUMaterial *material, const bNode *bnode, const char *name, GPUNodeStack *in, GPUNodeStack *out, int zone_index, bool is_zone_end, int in_argument_count, int out_argument_count)
void register_node_type_sh_light_iter_internal_output()
void search_link_ops_for_shader_material_lighting_node(nodes::GatherLinkSearchOpParams &params)
Defines a node type.
Definition BKE_node.hh:265
std::string ui_description
Definition BKE_node.hh:271
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:373
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeGatherSocketLinkOperationsFunction gather_link_search_ops
Definition BKE_node.hh:409
NodeDeclareFunction declare
Definition BKE_node.hh:393
bool(*) add_ui_poll(const bContext *C)
Definition BKE_node.hh:341