Blender  V3.3
node_shader_wireframe.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::Float>(N_("Size")).default_value(0.01f).min(0.0f).max(100.0f);
14  b.add_output<decl::Float>(N_("Fac"));
15 }
16 
18 {
19  uiItemR(layout, ptr, "use_pixel_size", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, 0);
20 }
21 
23  bNode *node,
24  bNodeExecData *UNUSED(execdata),
25  GPUNodeStack *in,
27 {
29  /* node->custom1 is use_pixel_size */
30  if (node->custom1) {
31  return GPU_stack_link(mat, node, "node_wireframe_screenspace", in, out);
32  }
33  else {
34  return GPU_stack_link(mat, node, "node_wireframe", in, out);
35  }
36 }
37 
38 } // namespace blender::nodes::node_shader_wireframe_cc
39 
40 /* node type definition */
42 {
43  namespace file_ns = blender::nodes::node_shader_wireframe_cc;
44 
45  static bNodeType ntype;
46 
51 
52  nodeRegisterType(&ntype);
53 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4465
#define NODE_CLASS_INPUT
Definition: BKE_node.h:345
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1357
#define UNUSED(x)
@ GPU_MATFLAG_BARYCENTRIC
Definition: GPU_material.h:85
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
Definition: gpu_material.c:596
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud SH_NODE_WIREFRAME
@ 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 void node_shader_buts_wireframe(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
static int node_shader_gpu_wireframe(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass)
void register_node_type_sh_wireframe()
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