Blender V5.0
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
5#include "node_shader_util.hh"
6
8
10{
11 b.add_input<decl::Shader>("Surface");
12}
13
15 bNode * /*node*/,
16 bNodeExecData * /*execdata*/,
18 GPUNodeStack * /*out*/)
19{
20 GPUNodeLink *outlink_surface;
21 /* Passthrough node in order to do the right socket conversions. */
22 if (in[0].link) {
23 /* Reuse material output. */
24 GPU_link(mat, "node_output_material_surface", in[0].link, &outlink_surface);
25 GPU_material_output_surface(mat, outlink_surface);
26 }
27 return true;
28}
29
30} // namespace blender::nodes::node_shader_output_light_cc
31
32/* node type definition */
34{
36
37 static blender::bke::bNodeType ntype;
38
39 sh_node_type_base(&ntype, "ShaderNodeOutputLight", SH_NODE_OUTPUT_LIGHT);
40 ntype.ui_name = "Light Output";
41 ntype.ui_description = "Output light information to a light object";
42 ntype.enum_name_legacy = "OUTPUT_LIGHT";
44 ntype.declare = file_ns::node_declare;
46 ntype.gpu_fn = file_ns::node_shader_gpu_output_light;
47
48 ntype.no_muting = true;
49
51}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:448
#define SH_NODE_OUTPUT_LIGHT
void GPU_material_output_surface(GPUMaterial *material, GPUNodeLink *link)
bool GPU_link(GPUMaterial *mat, const char *name,...)
#define in
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
static int node_shader_gpu_output_light(GPUMaterial *mat, bNode *, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *)
static void node_declare(NodeDeclarationBuilder &b)
void register_node_type_sh_output_light()
void sh_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
bool object_cycles_shader_nodes_poll(const bContext *C)
Defines a node type.
Definition BKE_node.hh:238
std::string ui_description
Definition BKE_node.hh:244
bool(* add_ui_poll)(const bContext *C)
Definition BKE_node.hh:310
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:342
const char * enum_name_legacy
Definition BKE_node.hh:247
NodeDeclareFunction declare
Definition BKE_node.hh:362