Blender  V2.93
node_shader_particle_info.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2005 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #include "../node_shader_util.h"
21 #include "RE_texture.h"
22 
24  {SOCK_FLOAT, "Index"},
25  {SOCK_FLOAT, "Random"},
26  {SOCK_FLOAT, "Age"},
27  {SOCK_FLOAT, "Lifetime"},
28  {SOCK_VECTOR, "Location"},
29 #if 0 /* quaternion sockets not yet supported */
30  {SOCK_QUATERNION, "Rotation"},
31 #endif
32  {SOCK_FLOAT, "Size"},
33  {SOCK_VECTOR, "Velocity"},
34  {SOCK_VECTOR, "Angular Velocity"},
35  {-1, ""},
36 };
38  int UNUSED(thread),
39  bNode *UNUSED(node),
40  bNodeExecData *UNUSED(execdata),
41  bNodeStack **UNUSED(in),
42  bNodeStack **UNUSED(out))
43 {
44 }
45 
47  bNode *node,
48  bNodeExecData *UNUSED(execdata),
49  GPUNodeStack *in,
50  GPUNodeStack *out)
51 {
52 
53  return GPU_stack_link(mat,
54  node,
55  "particle_info",
56  in,
57  out,
62 }
63 
64 /* node type definition */
66 {
67  static bNodeType ntype;
68 
69  sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0);
73 
74  nodeRegisterType(&ntype);
75 }
void node_type_gpu(struct bNodeType *ntype, NodeGPUExecFunction gpu_fn)
Definition: node.cc:4645
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
Definition: node.cc:4527
#define NODE_CLASS_INPUT
Definition: BKE_node.h:334
void node_type_exec(struct bNodeType *ntype, NodeInitExecFunction init_exec_fn, NodeFreeExecFunction free_exec_fn, NodeExecFunction exec_fn)
Definition: node.cc:4635
void nodeRegisterType(struct bNodeType *ntype)
Definition: node.cc:1298
#define UNUSED(x)
@ SOCK_VECTOR
@ SOCK_FLOAT
GPUNodeLink * GPU_builtin(eGPUBuiltin builtin)
@ GPU_PARTICLE_ANG_VELOCITY
Definition: GPU_material.h:99
@ GPU_PARTICLE_SCALAR_PROPS
Definition: GPU_material.h:96
@ GPU_PARTICLE_VELOCITY
Definition: GPU_material.h:98
@ GPU_PARTICLE_LOCATION
Definition: GPU_material.h:97
bool GPU_stack_link(GPUMaterial *mat, struct bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
Group RGB to Bright Vector Camera Vector Combine Material Light Line Style Layer Add Ambient Diffuse Glossy Refraction Transparent Toon Principled Hair Volume Principled Light SH_NODE_PARTICLE_INFO
OperationNode * node
static bNodeSocketTemplate outputs[]
static int gpu_shader_particle_info(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
void register_node_type_sh_particle_info(void)
static void node_shader_exec_particle_info(void *UNUSED(data), int UNUSED(thread), bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out))
void sh_node_type_base(struct bNodeType *ntype, int type, const char *name, short nclass, short flag)
Compact definition of a node socket.
Definition: BKE_node.h:95
Defines a node type.
Definition: BKE_node.h:221