Blender  V3.3
node_shader_bsdf_hair.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 
6 #include "UI_interface.h"
7 #include "UI_resources.h"
8 
10 
12 {
13  b.add_input<decl::Color>(N_("Color")).default_value({0.8f, 0.8f, 0.8f, 1.0f});
14  b.add_input<decl::Float>(N_("Offset"))
15  .default_value(0.0f)
16  .min(-M_PI_2)
17  .max(M_PI_2)
18  .subtype(PROP_ANGLE);
19  b.add_input<decl::Float>(N_("RoughnessU"))
20  .default_value(0.1f)
21  .min(0.0f)
22  .max(1.0f)
23  .subtype(PROP_FACTOR);
24  b.add_input<decl::Float>(N_("RoughnessV"))
25  .default_value(1.0f)
26  .min(0.0f)
27  .max(1.0f)
28  .subtype(PROP_FACTOR);
29  b.add_input<decl::Vector>(N_("Tangent")).hide_value();
30  b.add_input<decl::Float>(N_("Weight")).unavailable();
31  b.add_output<decl::Shader>(N_("BSDF"));
32 }
33 
35 {
36  uiItemR(layout, ptr, "component", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
37 }
38 
40  bNode *node,
41  bNodeExecData *UNUSED(execdata),
42  GPUNodeStack *in,
44 {
45  return GPU_stack_link(mat, node, "node_bsdf_hair", in, out);
46 }
47 
48 } // namespace blender::nodes::node_shader_bsdf_hair_cc
49 
50 /* node type definition */
52 {
53  namespace file_ns = blender::nodes::node_shader_bsdf_hair_cc;
54 
55  static bNodeType ntype;
56 
60  node_type_size(&ntype, 150, 60, 200);
62 
63  nodeRegisterType(&ntype);
64 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
void node_type_size(struct bNodeType *ntype, int width, int minwidth, int maxwidth)
Definition: node.cc:4396
#define SH_NODE_BSDF_HAIR
Definition: BKE_node.h:1156
#define NODE_CLASS_SHADER
Definition: BKE_node.h:358
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define M_PI_2
Definition: BLI_math_base.h:23
#define UNUSED(x)
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ PROP_ANGLE
Definition: RNA_types.h:145
@ PROP_FACTOR
Definition: RNA_types.h:144
@ UI_ITEM_R_SPLIT_EMPTY_NAME
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon)
OperationNode * node
static void node_declare(NodeDeclarationBuilder &b)
static int node_shader_gpu_bsdf_hair(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static void node_shader_buts_hair(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_sh_bsdf_hair()
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition: BKE_node.h:226
void(* draw_buttons)(struct uiLayout *, struct bContext *C, struct PointerRNA *ptr)
Definition: BKE_node.h:244
NodeDeclareFunction declare
Definition: BKE_node.h:324
#define N_(msgid)
PointerRNA * ptr
Definition: wm_files.c:3480