Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_particle_info.cc
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2005 Blender Foundation. | * The Original Code is Copyright (C) 2005 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| #include "RE_texture.h" | #include "RE_texture.h" | ||||
| #include "node_shader_util.hh" | #include "node_shader_util.hh" | ||||
| namespace blender::nodes::node_shader_particle_info_cc { | |||||
| static bNodeSocketTemplate outputs[] = { | static bNodeSocketTemplate outputs[] = { | ||||
| {SOCK_FLOAT, "Index"}, | {SOCK_FLOAT, "Index"}, | ||||
| {SOCK_FLOAT, "Random"}, | {SOCK_FLOAT, "Random"}, | ||||
| {SOCK_FLOAT, "Age"}, | {SOCK_FLOAT, "Age"}, | ||||
| {SOCK_FLOAT, "Lifetime"}, | {SOCK_FLOAT, "Lifetime"}, | ||||
| {SOCK_VECTOR, "Location"}, | {SOCK_VECTOR, "Location"}, | ||||
| #if 0 /* quaternion sockets not yet supported */ | #if 0 /* quaternion sockets not yet supported */ | ||||
| {SOCK_QUATERNION, "Rotation"}, | {SOCK_QUATERNION, "Rotation"}, | ||||
| Show All 25 Lines | return GPU_stack_link(mat, | ||||
| in, | in, | ||||
| out, | out, | ||||
| GPU_builtin(GPU_PARTICLE_SCALAR_PROPS), | GPU_builtin(GPU_PARTICLE_SCALAR_PROPS), | ||||
| GPU_builtin(GPU_PARTICLE_LOCATION), | GPU_builtin(GPU_PARTICLE_LOCATION), | ||||
| GPU_builtin(GPU_PARTICLE_VELOCITY), | GPU_builtin(GPU_PARTICLE_VELOCITY), | ||||
| GPU_builtin(GPU_PARTICLE_ANG_VELOCITY)); | GPU_builtin(GPU_PARTICLE_ANG_VELOCITY)); | ||||
| } | } | ||||
| } // namespace blender::nodes::node_shader_particle_info_cc | |||||
| /* node type definition */ | /* node type definition */ | ||||
| void register_node_type_sh_particle_info() | void register_node_type_sh_particle_info() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_shader_particle_info_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0); | sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT, 0); | ||||
| node_type_socket_templates(&ntype, nullptr, outputs); | node_type_socket_templates(&ntype, nullptr, file_ns::outputs); | ||||
| node_type_exec(&ntype, nullptr, nullptr, node_shader_exec_particle_info); | node_type_exec(&ntype, nullptr, nullptr, file_ns::node_shader_exec_particle_info); | ||||
| node_type_gpu(&ntype, gpu_shader_particle_info); | node_type_gpu(&ntype, file_ns::gpu_shader_particle_info); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||