Blender  V3.3
node_shader_particle_info.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 "RE_texture.h"
7 
9 
11 {
12  b.add_output<decl::Float>(N_("Index"));
13  b.add_output<decl::Float>(N_("Random"));
14  b.add_output<decl::Float>(N_("Age"));
15  b.add_output<decl::Float>(N_("Lifetime"));
16  b.add_output<decl::Vector>(N_("Location"));
17 #if 0 /* quaternion sockets not yet supported */
18  b.add_output<decl::Quaternion>(N_("Rotation"));
19 #endif
20  b.add_output<decl::Float>(N_("Size"));
21  b.add_output<decl::Vector>(N_("Velocity"));
22  b.add_output<decl::Vector>(N_("Angular Velocity"));
23 }
24 
26  bNode *node,
27  bNodeExecData *UNUSED(execdata),
28  GPUNodeStack *in,
30 {
32  /* TODO(fclem) Pass particle data in obinfo. */
33  return GPU_stack_link(mat, node, "particle_info", in, out);
34 }
35 
36 } // namespace blender::nodes::node_shader_particle_info_cc
37 
38 /* node type definition */
40 {
42 
43  static bNodeType ntype;
44 
45  sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT);
48 
49  nodeRegisterType(&ntype);
50 }
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_OBJECT_INFO
Definition: GPU_material.h:82
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 SH_NODE_PARTICLE_INFO
OperationNode * node
static int gpu_shader_particle_info(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_particle_info()
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)