Hi, I posted a similar question but I get no answer so I simplify it in this forum. Please do not mark as duplicate. If I have a 2d float array like (float[][] transformMatrix = new float[][]) I want to send it to the shader to be used with the inPosition:
void main()
{
gl_Position = transformation * in_Position;
}
I tried like this:
glUseProgram(programID);
for(int i = 0; i < 4;i++) {
for(int j = 0;j<4;j++) {
matrix44Buffer.put(transformation.mat[i][j]);
}
}
glUniformMatrix4fv(MatrixLocation, false, matrix44Buffer);
matrix44Buffer.flip();
glUseProgram(0);
It isn't working. How to send the float[][] to the shader? All the websites that I found were using JOML or lwjgl 2 which has its own matrices.