Matrix palette skinning

Hello,

I’m new on the codea forums, and i’m trying to create a shader to skin my skeletal character. For this, i need to pass an array of matrices to my vertex program that will represent the bones’ transform.
I have tried to declare something like this :

uniform mat4 matBones[20];

…but it does not seem to work, and i have not been able to feed the matrices in lua.
Are uniform arrays supported on Codea ? Do you have any advice on how to make this work ?

Thanks in advance
-Nicolas

I reccomend looking at @Ignatz’s ebook on shaders

My book on shaders doesn’t cover this, but see discussion here

http://twolivesleft.com/Codea/Talk/discussion/comment/23409

And here

http://twolivesleft.com/Codea/Talk/discussion/2266

Both of which mention this issue. The second one seems to include shaders with uniform arrays, but they are 1D.

I’ve experimented with arrays of matrices in shaders and it hasn’t worked. I tried pretty extensively so I’m reasonably confident in asserting that it isn’t possible at the moment. But I don’t discount the possibility that I overlooked something.

I suspect we have not implemented support for matrix arrays, I’ll have to confirm with @John. It shouldn’t be too hard to add support for this feature, just remember that there is a total number of floats that can be uploaded to a shader via uniforms, so matrix arrays will quickly eat into this limit.

Hi guys, thank you for the answers and the various links, this is most useful.
@Simeon, I think that it would be fantastic if you could add support for this feature, as it would open up new possibilities for shaders.
In the meantime, i will try other experiments with shaders…
Thanks
-Nicolas