Godot: Vertex color breaks if number of colors mismatches number of polygon vertices

Created on 19 Jan 2019  路  3Comments  路  Source: godotengine/godot

As of 3.1 beta 2. Likely related to #20601. Having a different number causes the vertex color to not work at all. This can be tested in 2 ways: either changing the vertex colors array size or by adding/deleting vertices (in either case, vertex colors will pop off or on depending on if the number matches).

Behavior in beta 1 and before is that undefined vertex colors were inherited from the color property.

Now it seems this is likely an intentional change, at least because adding internal vertices causes the vertex colors array size to automatically update (the new color defaulting to white rather than the color property)... but aside from breakage, it also makes working with polygons+vertex colors even more clunky (and it's bad enough coloring vertices by number rather than having an editor).

In many cases, this isn't just a matter of changing the array size to match the number of vertices either, as the inheritance of the color property (as I mentioned before) is now gone. So not only would you need to paste it in for every unspecified vertex, you'd also better hope that you don't plan on changing it (or the number of vertices in the polygon!) for any reason (that would be mitigated if there were some sort of a palette system, particularly if you could specify colors in groups. Like vertices 22-46 are this color and vertices 1, 2, 5, 7 are this color etc.).

That and I think it's fairly obvious the old method was a more helpful/intuitive behavior.

bug confirmed discussion editor

Most helpful comment

I think vertex colors should probably be implemented properly, including the ability to paint them in the UV editor.. but did not have much time for this. I want to eventually rewrite the internals of Polygon2D so it does not expose arrays any longer and everything is done via the editor (Which should be moved to the bottom).

Unfortunately these changes both break compatibility and it's too late on the 3.1 cycle to do them. I have noted those and many other changes to be done for 4.0 to improve Polygon2D.

All 3 comments

I think vertex colors should probably be implemented properly, including the ability to paint them in the UV editor.. but did not have much time for this. I want to eventually rewrite the internals of Polygon2D so it does not expose arrays any longer and everything is done via the editor (Which should be moved to the bottom).

Unfortunately these changes both break compatibility and it's too late on the 3.1 cycle to do them. I have noted those and many other changes to be done for 4.0 to improve Polygon2D.

Sorry about the late response... but the vertex color editor thing was only a mention with this issue, as in can't the array mis-match behavior be restored to how it was in previous versions? Or was there a reason (perhaps internal, related to internal vertices) for changing that?

Still valid in 0287508

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ducdetronquito picture ducdetronquito  路  3Comments

nunodonato picture nunodonato  路  3Comments

bojidar-bg picture bojidar-bg  路  3Comments

Spooner picture Spooner  路  3Comments

Zylann picture Zylann  路  3Comments