diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-04-02 12:28:03 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-04-06 13:19:02 +0300 |
commit | cc0819aee119ad7a9dc9c383ec6895208ea1a184 (patch) | |
tree | d855e65e3a93076d8270e8d5de31eea2e7cdd45d | |
parent | ccaf6c74044d30bc2de9db033a703319d79127a7 (diff) |
Fix (unreported) wrong hair vertex colors
This was already fixed in rB985f33719ce9 once.
But resurfaced after rB7070e4c15e6c [which just reverted a bit too much
;)].
Spotted while looking into T75263.
Differential Revision: https://developer.blender.org/D7308
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_particles.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index dca4f8e01e6..331a1f80bec 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -339,7 +339,8 @@ static void particle_calculate_parent_mcol(ParticleSystem *psys, if (num != DMCACHE_NOTFOUND && num != DMCACHE_ISCHILD) { MFace *mface = &psmd->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]); + /* CustomDataLayer CD_MCOL has 4 structs per face. */ + psys_interpolate_mcol(mcols[j] + num * 4, mface->v4, particle->fuv, &r_mcol[j]); } } } @@ -388,6 +389,7 @@ static void particle_interpolate_children_mcol(ParticleSystem *psys, if (num != DMCACHE_NOTFOUND) { MFace *mface = &psmd->mesh_final->mface[num]; for (int j = 0; j < num_col_layers; j++) { + /* CustomDataLayer CD_MCOL has 4 structs per face. */ psys_interpolate_mcol(mcols[j] + num * 4, mface->v4, particle->fuv, &r_mcol[j]); } } |