Blender  V3.3
node_shader_output_light.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2005 Blender Foundation. All rights reserved. */
3 
4 #include "node_shader_util.hh"
5 
7 
9 {
10  b.add_input<decl::Shader>(N_("Surface"));
11 }
12 
14  bNode *UNUSED(node),
15  bNodeExecData *UNUSED(execdata),
16  GPUNodeStack *in,
18 {
19  GPUNodeLink *outlink_surface;
20  /* Passthrough node in order to do the right socket conversions. */
21  if (in[0].link) {
22  /* Reuse material output. */
23  GPU_link(mat, "node_output_material_surface", in[0].link, &outlink_surface);
24  GPU_material_output_surface(mat, outlink_surface);
25  }
26  return true;
27 }
28 
29 } // namespace blender::nodes::node_shader_output_light_cc
30 
31 /* node type definition */
33 {
35 
36  static bNodeType ntype;
37 
41 
42  ntype.no_muting = true;
43 
44  nodeRegisterType(&ntype);
45 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
#define NODE_CLASS_OUTPUT
Definition: BKE_node.h:346
#define SH_NODE_OUTPUT_LIGHT
Definition: BKE_node.h:1103
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
void GPU_material_output_surface(GPUMaterial *material, GPUNodeLink *link)
Definition: gpu_material.c:503
bool GPU_link(GPUMaterial *mat, const char *name,...)
OperationNode * node
static int node_shader_gpu_output_light(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *UNUSED(out))
static void node_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_sh_output_light()
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition: BKE_node.h:226
NodeDeclareFunction declare
Definition: BKE_node.h:324
bool no_muting
Definition: BKE_node.h:338
#define N_(msgid)