Blender V5.3
node_shader_output_light.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2005 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{
17 b.add_input<decl::Shader>("Surface"_ustr);
18}
19
21 bNode * /*node*/,
22 bNodeExecData * /*execdata*/,
24 GPUNodeStack * /*out*/)
25{
26 GPUNodeLink *outlink_surface;
27 /* Passthrough node in order to do the right socket conversions. */
28 if (in[0].link) {
29 /* Reuse material output. */
30 GPU_link(mat, "node_output_material_surface", in[0].link, &outlink_surface);
31 GPU_material_output_surface(mat, outlink_surface);
32 }
33 return true;
34}
35
36} // namespace nodes::node_shader_output_light_cc
37
38/* node type definition */
40{
41 namespace file_ns = nodes::node_shader_output_light_cc;
42
43 static bke::bNodeType ntype;
44
45 sh_node_type_base(&ntype, "ShaderNodeOutputLight"_ustr, SH_NODE_OUTPUT_LIGHT);
46 ntype.ui_name = "Light Output";
47 ntype.ui_description = "Output light information to a light object";
48 ntype.enum_name_legacy = "OUTPUT_LIGHT";
50 ntype.declare = file_ns::node_declare;
52 ntype.gpu_fn = file_ns::node_shader_gpu_output_light;
53
54 ntype.no_muting = true;
55
57}
58
59} // namespace blender
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:479
#define SH_NODE_OUTPUT_LIGHT
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static int node_shader_gpu_output_light(GPUMaterial *mat, bNode *, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *)
static void node_declare(NodeDeclarationBuilder &b)
BMesh Iterators.
void GPU_material_output_surface(GPUMaterial *material, GPUNodeLink *link)
bool object_cycles_shader_nodes_poll(const bContext *C)
void sh_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool GPU_link(GPUMaterial *mat, const char *name,...)
void register_node_type_sh_output_light()
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
NodeDeclareFunction declare
Definition BKE_node.hh:393
bool(*) add_ui_poll(const bContext *C)
Definition BKE_node.hh:341