elm-explorations/webgl

Allow Mat4 to be used as attribute to vertex shader

Closed this issue · 3 comments

Just ran into an issue where I was getting this error:

Uncaught Error: No info available for: 35676
    at _WebGL_doBindAttribute (Main.elm:6110)
    ...

After a little digging I discovered it's because there's no support for mat4 attributes.

It seems like this should be possible to do, and pretty straightforward: https://stackoverflow.com/questions/38853096/webgl-how-to-bind-values-to-a-mat4-attribute

My use case is passing in a separate transform for each Entity as an attribute, in order to do the transformation on the GPU. I'm willing to make the change, just wanted to get some opinions first.

w0rm commented

@emptyflash this seems like an overlook. I've never had such use case so I kept this code.

I think if it is possible to add Mat4 support without changing the api, then we should do it.

w0rm commented

@emptyflash did you work on this?

@w0rm unfortunately I haven't had the time to actually fix this. I was able to workaround it by sending 4 vec4s as attributes.