Page MenuHome

Fix (unreported) wrong hair vertex colors
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Apr 2 2020, 11:39 AM.

Details

Summary

This was already fixed in rB985f33719ce9 once.
But resurfaced after rB7070e4c15e6c [which just reverted a bit too much
;)].

Spotted while looking into T75263.

Diff Detail

Repository
rB Blender
Branch
vertex_colors_hair_again (branched from master)
Build Status
Buildable 7414
Build 7414: arc lint + arc unit

Event Timeline

testfile:

If it's an unwanted part of revert -- sure.

But I can see that it worth explaining in the comment why it needs to be *4.

But I can see that it worth explaining in the comment why it needs to be *4.

Here is my explanation:
Prior to rB328f8dc21c0e: DRW: Add new GPU hair system. vertexcolors were not handled (UVs were).
So I guess that commit copied code from particle_interpolate_children_uvs [which used psys_interpolate_uvs] to the new particle_calculate_parent_mcol [which uses psys_interpolate_mcol]
However, you cannot use psys_interpolate_uvs / psys_interpolate_mcol the same way:

  • CustomDataLayer CD_MCOL has 4 structs per face
  • CustomDataLayer CD_MTFACE has only one struct per face

(Please also see usage of psys_interpolate_mcol in rna_ParticleSystem_mcol_on_emitter)

add comment about CD_MCOL CustomData layer

This revision is now accepted and ready to land.Apr 6 2020, 11:54 AM