Passing mat4 array to shader uniform

Hi all!

I want to pass an array of mat4 transformation matrices to a uniform in a PShader object, defined like this:


uniform mat4 jointTransforms[MAX_JOINTS];

I cannot see this option neither in the reference nor in the PShader source. While at looking at it i tried to convert the trnasform to a FloatBuffer and pass it like this:


int matGlobalParam = pgl.getUniformLocation(shader.glProgram, "jointTransforms");		
FloatBuffer floatBuffer = entity.getJointTransformsFB(); //convert matrices to floatbuffer method
floatBuffer.position(0);
pgl.uniformMatrix4fv(matGlobalParam , entity.jointCount , false, floatBuffer);

But it doeant look like its working. How should it bedone? Thanks!

Found that the code works if I add shader.bind() after beginPGL() and shader.unbind() before the endPGL() ¯_(ツ)_/¯