From f6107af4cf4d907495e2e9c18e5866fd1d420650 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 14 Feb 2018 14:32:38 +0100 Subject: Cycles: change Index output of Hair and Particle Info to Random, in 0..1 range. These are used for randomization, so it's convenient if the index is already hashed and consistent with the Object Info node. --- source/blender/gpu/intern/gpu_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/gpu/intern') diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index 427e179f29a..d7e744951c4 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -41,11 +41,11 @@ #include "GPU_glew.h" #include "BLI_blenlib.h" +#include "BLI_hash.h" #include "BLI_linklist.h" #include "BLI_math.h" #include "BLI_threads.h" #include "BLI_utildefines.h" -#include "BLI_hash.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" @@ -1884,7 +1884,7 @@ static int gpu_get_particle_info(GPUParticleInfo *pi) if (ind >= 0) { ParticleData *p = &dob->particle_system->particles[ind]; - pi->scalprops[0] = ind; + pi->scalprops[0] = BLI_hash_int_01(ind); pi->scalprops[1] = GMS.gscene->r.cfra - p->time; pi->scalprops[2] = p->lifetime; pi->scalprops[3] = p->size; -- cgit v1.2.3