Blender V4.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
5#include "node_shader_util.hh"
6
8
10{
11 b.add_input<decl::Shader>("Surface");
12}
13
15 bNode * /*node*/,
16 bNodeExecData * /*execdata*/,
17 GPUNodeStack *in,
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
40 ntype.declare = file_ns::node_declare;
42 ntype.gpu_fn = file_ns::node_shader_gpu_output_light;
43
44 ntype.no_muting = true;
45
47}
#define NODE_CLASS_OUTPUT
Definition BKE_node.hh:405
#define SH_NODE_OUTPUT_LIGHT
Definition BKE_node.hh:915
void GPU_material_output_surface(GPUMaterial *material, GPUNodeLink *link)
bool GPU_link(GPUMaterial *mat, const char *name,...)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
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, int type, const char *name, short nclass)
bool object_cycles_shader_nodes_poll(const bContext *C)
Defines a node type.
Definition BKE_node.hh:218
bool(* add_ui_poll)(const bContext *C)
Definition BKE_node.hh:288
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:318
NodeDeclareFunction declare
Definition BKE_node.hh:347