how to send to a shader attribute with the MAT4 type?
attribute mat4 attr;
...
JS:
var attr=gl.getAttribLocation(_program,"attr");
how to send to a shader attribute with the MAT4 type?
attribute mat4 attr;
...
JS:
var attr=gl.getAttribLocation(_program,"attr");
From the spec section 2.10.4
so
JS:
As for getting the data the most common way would be to put all the matrices in one buffer so
then to set up the attributes
Something to be aware of. If you're debugging and you comment out
attr
in your shader thenrow0Location
will be -1 and calling all thegl.vertexAttrib
functions with a -1 location is a no-op which is good. But, because you compute the other locationsrow1Location
,row2Location
androw3Location
will be valid attribute locations as far as WebGL is concern but invalid as far as your program is concerned. Not a big deal just something to keep in mind.