diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-14 19:02:28 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-14 23:45:57 +0300 |
commit | b5fe00d1ac43c16ec8f74d3ad7689599dfb2ef00 (patch) | |
tree | e2dcae056cde3c6eaa3bcaf2c1b9117a0a5e87a1 /source/blender/render | |
parent | f6107af4cf4d907495e2e9c18e5866fd1d420650 (diff) |
Cycles: restore Particle Info Index for now, keep it next to Random.
It seems to be useful still in cases where the particle are distributed in
a particular order or pattern, to colorize them along with that. This isn't
really well defined, but might as well avoid breaking backwards compatibility
for now.
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/extern/include/RE_shader_ext.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/renderdatabase.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index b64c0c8fc52..e1cb922f6a5 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -217,7 +217,7 @@ int multitex_nodes(struct Tex *tex, float texvec[3], float dxt[3], float dyt[3], const short thread, short which_output, struct ShadeInput *shi, struct MTex *mtex, struct ImagePool *pool); float RE_lamp_get_data(struct ShadeInput *shi, struct Object *lamp_obj, float col[4], float lv[3], float *dist, float shadow[4]); -void RE_instance_get_particle_info(struct ObjectInstanceRen *obi, float *index, float *age, float *lifetime, float co[3], float *size, float vel[3], float angvel[3]); +void RE_instance_get_particle_info(struct ObjectInstanceRen *obi, float *index, float *random, float *age, float *lifetime, float co[3], float *size, float vel[3], float angvel[3]); float RE_fresnel_dielectric(float incoming[3], float normal[3], float eta); diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 199322795f3..2fbfcc64c8f 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1482,9 +1482,10 @@ ObjectInstanceRen *RE_addRenderInstance( return obi; } -void RE_instance_get_particle_info(struct ObjectInstanceRen *obi, float *index, float *age, float *lifetime, float co[3], float *size, float vel[3], float angvel[3]) +void RE_instance_get_particle_info(struct ObjectInstanceRen *obi, float *index, float *random, float *age, float *lifetime, float co[3], float *size, float vel[3], float angvel[3]) { *index = obi->part_index; + *random = BLI_hash_int_01(obi->part_index); *age = obi->part_age; *lifetime = obi->part_lifetime; copy_v3_v3(co, obi->part_co); |