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-07-26 15:40:58 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-07-26 15:40:58 +0400
commitfec872ef9c0bb6904cbe9a7b59b3f51ae7bb0702 (patch)
treeaeb75f40ec873b33dd1e76e55ab0f05eac1768a9 /intern/cycles/render/object.cpp
parent53a861b6f9ece221089b9364fa5a9e87175b580c (diff)
Added a particle index output to the Particle Info Cycles node. This is required to get consistent ID numbers for particles. The Object ID is not usable since it's a user defined value of the instanced object, which does not vary per instance. Also the random value from the object info node is not consistent over time, since it only depends on the index in the dupli list (so each emitted or dying particle shifts the value).
The particle index is always the same for a specific particle. Randomized values can be generated from this with the use of a noise texture.
Diffstat (limited to 'intern/cycles/render/object.cpp')
-rw-r--r--intern/cycles/render/object.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index 6de7eaea343..c4b25e633bf 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -269,7 +269,7 @@ void ObjectManager::device_update_particles(Device *device, DeviceScene *dscene,
/* pack in texture */
int offset = i*PARTICLE_SIZE;
- particles[offset] = make_float4(pa.age, pa.lifetime, 0.0f, 0.0f);
+ particles[offset] = make_float4(pa.index, pa.age, pa.lifetime, 0.0f);
i++;