I have this uniform in glsl
uniform mat4 u_MVPMatrix[64];
that is filled with 64 matrices
its used to transform 64 shapes in my game. It works good!!!
My question if its possible change a part of this matrix-vector if I for instance want to rotate or resize a certain sprite? Could I use the method:
glUniformMatrix4fv(int location, int count, boolean transpose, float[] value, int offset)
?
I do not understand the offset argument, I thought was it used as an offset into the matrix-vec in glsl but obviously not?
GLES30.glUniformMatrix4fv(mMVPMatrixHandleEyes, 1, false, mMVPMatrixEyes, 1);
IF I change the offset argument I get an exception:
java.lang.IllegalArgumentException: length - offset < count*16 < needed
at android.opengl.GLES20.glUniformMatrix4fv(Native Method)
What is the solution to this issue? Should I instead focus om making the change on the GPU-side? But could a uniform be changed?