From 5e1bbde01d0a77c7b032197cff860305462a9cb2 Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Fri, 8 Jun 2012 16:17:57 +0000 Subject: Particle Info node for Cycles. This can be used to access particle information in material shaders for dupli objects. For now only the particle Age and individual Lifetime (in frames) are supported, more attributes can be added when needed. The particle data is stored in a separate texture if any of the dupli objects uses particle info nodes in shaders. To map dupli objects onto particles the store an additional particle_index value, which is different from the simple dupli object index (only visible particles, also works for particle dupli groups mode). Some simple use cases on the code.blender.org blog: http://code.blender.org/index.php/2012/05/particle-info-node/ --- source/blender/makesdna/DNA_object_types.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/makesdna/DNA_object_types.h') diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 44d7ec660f2..24d33b49db2 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -301,6 +301,15 @@ typedef struct DupliObject { short type; /* from Object.transflag */ char no_draw, animated; + + /* Lowest-level particle index. + * Note: This is needed for particle info in shaders. + * Otherwise dupli groups in particle systems would override the + * index value from higher dupli levels. Would be nice to have full generic access + * to all dupli levels somehow, but for now this should cover most use-cases. + */ + int particle_index; + int pad; } DupliObject; /* **************** OBJECT ********************* */ -- cgit v1.2.3