Vertex color (again and again)

I have read in the release notes that some steps towards vertex color have been made; but I don’t have a clear idea of what is possible and what is still not possible.

In particular I would like to use a mesh with vertex colors, is it possible? If so, any code examples or link to some code examples?

Thank you so much!

Are you talking about the mesh component or just a mesh in general? I.e using a mesh in a model component

I have to admit I don’t understand the difference model / mesh in Defold.

I would like to deform a mesh in runtime by moving its vertices and have vertex colors.

I hope this clarify somehow my question.

Thanks @jhonny.goransson

Yeah, you can use the mesh component to do that. With the mesh component you can create a layout that matches your shader. I think this is the best source of information right now how to use it:

Otherwise I guess we could maybe make a small example on how to create a dynamic mesh :thinking:

2 Likes

Thanks, I will try to understand how to create a dynamic mesh.

A related question.

I see that in 1.4.8 custom vertex attributes have been introduced for materials. If I correctly understand these attributes are editable in the editor but, for the moment, they cannot be set in a script. Is it so?

But, in the editor and in the future API, are these attributes constant for all the four vertices of a sprite? Or can be independently set for each vertex? Again, if I correctly understand, when setting one such attribute via the editor this is the same for all four vertices. Am I missing something here?

Thanks!

Currently we only have support for the custom vertex setup for sprites and particles with models in development.

We have plans to introduce a script API for setting vertex data, but the design isn’t finalized yet but you will either be able to update the vertices individually or the constant data for the attribute, or maybe both.

2 Likes

Thank you so much for the information. Looking forward to see the API! this will be a very interesting, and in my opinion important, improvement for the engine.

Ciao!

There’s also 3D meshes in Defold

1 Like