API improvements for meshes & custom shaders

Hi,

Mario from Esoteric Software here, makers of Spine. I was wondering if you had any plans to expand the existing mesh and shader APIs to be a bit more flexible.

We are currently implementing two color tinting, which requires an additional vertex attribute (dark color) and a custom vertex and fragment shader, where the former passes on the dark color attribute as a varying, and the latter does the two color tinting based on the normal vertex color, the dark color and the texture sample.

We’ve implemented this for most runtimes already, e.g. here’s the Löve2D implementation to give you some idea https://github.com/EsotericSoftware/spine-runtimes/blob/3.6-beta/spine-love/spine-love/spine.lua#L88

Writting a custom vertex/fragment shader pair is already doable with the current API. However, we can not specify a custom vertex format. The per vertex user data is insufficient, as we actually have dark colors that may be unique per vertex, where as the vertex user data is unique per mesh.

Do you plan on adding a feature like this?

Cheers,

Mario

Thanks for the suggestion! This would be a good way to expand engine capabilities. Per vertex colouring would be nice to have. I will add it to “nice features to have” list, but can’t promise it would be done any time soon.

Thanks for the suggestion! This would be a good way to expand engine capabilities. Per vertex colouring would be nice to have. I will add it to “nice features to have” list, but can’t promise it would be done any time soon.