diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2019-06-16 00:37:55 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2019-06-16 09:34:19 +0300 |
commit | 985f33719ce9108d35d5f37b4c7c79d81f708a0d (patch) | |
tree | b6285db05f5d7080735bca99614e1bbe92de375c /source/blender/draw/intern/draw_cache_impl_particles.c | |
parent | 87de71a8aaa0fa6a4609ad05db35b9056f3e34a6 (diff) |
Fix T65844: wrong eevee hair when vertex colors are used as input
- was using wrong offset [index instead of index * 4]
- also minor correction to variable naming
Reviewers: fclem
Differential Revision: https://developer.blender.org/D5082
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_particles.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 2c66215de6e..467626bf2c8 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -318,7 +318,7 @@ static void particle_calculate_parent_uvs(ParticleSystem *psys, static void particle_calculate_parent_mcol(ParticleSystem *psys, ParticleSystemModifierData *psmd, - const int num_uv_layers, + const int num_col_layers, const int parent_index, /*const*/ MCol **mcols, MCol *r_mcol) @@ -340,8 +340,8 @@ static void particle_calculate_parent_mcol(ParticleSystem *psys, } if (num != DMCACHE_NOTFOUND && num != DMCACHE_ISCHILD) { MFace *mface = &mesh_final->mface[num]; - for (int j = 0; j < num_uv_layers; j++) { - psys_interpolate_mcol(mcols[j] + num, mface->v4, particle->fuv, &r_mcol[j]); + for (int j = 0; j < num_col_layers; j++) { + psys_interpolate_mcol(mcols[j] + num * 4, mface->v4, particle->fuv, &r_mcol[j]); } } } @@ -392,7 +392,7 @@ static void particle_interpolate_children_mcol(ParticleSystem *psys, if (num != DMCACHE_NOTFOUND) { MFace *mface = &mesh_final->mface[num]; for (int j = 0; j < num_col_layers; j++) { - psys_interpolate_mcol(mcols[j] + num, mface->v4, particle->fuv, &r_mcol[j]); + psys_interpolate_mcol(mcols[j] + num * 4, mface->v4, particle->fuv, &r_mcol[j]); } } } |