Blender V4.3
node_shader_particle_info.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_output<decl::Float>("Index");
12 b.add_output<decl::Float>("Random");
13 b.add_output<decl::Float>("Age");
14 b.add_output<decl::Float>("Lifetime");
15 b.add_output<decl::Vector>("Location");
16#if 0 /* quaternion sockets not yet supported */
17 b.add_output<decl::Quaternion>("Rotation");
18#endif
19 b.add_output<decl::Float>("Size");
20 b.add_output<decl::Vector>("Velocity");
21 b.add_output<decl::Vector>("Angular Velocity");
22}
23
25 bNode *node,
26 bNodeExecData * /*execdata*/,
27 GPUNodeStack *in,
28 GPUNodeStack *out)
29{
31 /* TODO(fclem) Pass particle data in obinfo. */
32 return GPU_stack_link(mat, node, "particle_info", in, out);
33}
34
36#ifdef WITH_MATERIALX
37{
38 /* NOTE: This node isn't supported by MaterialX. */
39 return get_output_default(socket_out_->name, NodeItem::Type::Any);
40}
41#endif
43
44} // namespace blender::nodes::node_shader_particle_info_cc
45
46/* node type definition */
48{
50
51 static blender::bke::bNodeType ntype;
52
54 ntype.declare = file_ns::node_declare;
55 ntype.gpu_fn = file_ns::gpu_shader_particle_info;
56 ntype.materialx_fn = file_ns::node_shader_materialx;
57
59}
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
#define SH_NODE_PARTICLE_INFO
Definition BKE_node.hh:951
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
@ GPU_MATFLAG_OBJECT_INFO
void GPU_material_flag_set(GPUMaterial *mat, eGPUMaterialFlag flag)
local_group_size(16, 16) .push_constant(Type b
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void node_declare(NodeDeclarationBuilder &b)
static int gpu_shader_particle_info(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
#define NODE_SHADER_MATERIALX_BEGIN
#define NODE_SHADER_MATERIALX_END
void register_node_type_sh_particle_info()
void sh_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeMaterialXFunction materialx_fn
Definition BKE_node.hh:320
NodeGPUExecFunction gpu_fn
Definition BKE_node.hh:318
NodeDeclareFunction declare
Definition BKE_node.hh:347