Blender  V3.3
node_shader_layer_weight.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::Float>(N_("Blend")).default_value(0.5f).min(0.0f).max(1.0f);
11  b.add_input<decl::Vector>(N_("Normal")).hide_value();
12  b.add_output<decl::Float>(N_("Fresnel"));
13  b.add_output<decl::Float>(N_("Facing"));
14 }
15 
17  bNode *node,
18  bNodeExecData *UNUSED(execdata),
19  GPUNodeStack *in,
21 {
22  if (!in[1].link) {
23  GPU_link(mat, "world_normals_get", &in[1].link);
24  }
25 
26  return GPU_stack_link(mat, node, "node_layer_weight", in, out);
27 }
28 
29 } // namespace blender::nodes::node_shader_layer_weight_cc
30 
31 /* node type definition */
33 {
35 
36  static bNodeType ntype;
37 
41 
42  nodeRegisterType(&ntype);
43 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
#define SH_NODE_LAYER_WEIGHT
Definition: BKE_node.h:1131
#define NODE_CLASS_INPUT
Definition: BKE_node.h:345
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
bool GPU_link(GPUMaterial *mat, const char *name,...)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
OperationNode * node
static int node_shader_gpu_layer_weight(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *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_layer_weight()
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
#define N_(msgid)