Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-08-31 23:38:59 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-08-31 23:38:59 +0400
commit9e3fa15d4b3e22127471a7451a49b594cf6275a0 (patch)
tree5891c5922401980fbb0843a60abd45278278f0c5 /source/blender/nodes
parentf0d247748408bd10f49c54d3a28a925e37683c4b (diff)
Added a bunch of additional particle state attributes to the Cycles particle info node:
* Location: Basically the same as the location from Object Info node for object instances on particles, but in principle there could be additional offsets for dupli objects, so included for completeness. * Size: Single float scale of the particle. Also directly translates to object scale for current dupli objects, but handy to have as a single float to start with instead of a scale vector (currently not even exposed in Object Info). * Rotation: This is a quaternion, which are not yet supported by Cycles nodes. The float4 is copied to internal Cycles data and stored in the particles texture data, but the node doesn't have a socket for it yet and the data is not yet written to the stack. Code is just commented out so could be enabled quickly if/when rotation support is added to cycles. * Velocity: Linear velocity vector of particles. * Angular Velocity: Angular velocity around principle axes. The texture data is currently packed tightly into the particles texture, which saves a few bytes, but requires an additional texture lookup for some vector attributes which spread over two float4s. Could also add another float4 to particle size to avoid this.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_particle_info.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_particle_info.c b/source/blender/nodes/shader/nodes/node_shader_particle_info.c
index 5be8925b556..ddfcb9476f4 100644
--- a/source/blender/nodes/shader/nodes/node_shader_particle_info.c
+++ b/source/blender/nodes/shader/nodes/node_shader_particle_info.c
@@ -31,6 +31,13 @@ static bNodeSocketTemplate outputs[] = {
{ SOCK_FLOAT, 0, "Index" },
{ SOCK_FLOAT, 0, "Age" },
{ SOCK_FLOAT, 0, "Lifetime" },
+ { SOCK_VECTOR, 0, "Location" },
+ #if 0 /* quaternion sockets not yet supported */
+ { SOCK_QUATERNION, 0, "Rotation" },
+ #endif
+ { SOCK_FLOAT, 0, "Size" },
+ { SOCK_VECTOR, 0, "Velocity" },
+ { SOCK_VECTOR, 0, "Angular Velocity" },
{ -1, 0, "" }
};