Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Matrix palette skinning

edited November 2013 in Shaders Posts: 2

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

Comments

  • I reccomend looking at @Ignatz's ebook on shaders

  • IgnatzIgnatz Mod
    edited November 2013 Posts: 5,396

    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.

  • Posts: 2,161

    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.

  • SimeonSimeon Admin Mod
    Posts: 4,587

    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.

  • Posts: 2

    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

Sign In or Register to comment.