I have a 2D array of floats (in this case it represents a 256 color palette with R G B values)
static float[][] glColorPaletteArray = new float[256][3];
I fill the array and now want to pass it to GLES. How do I pass a 2D array in android? I try
GLES20.glUniform3fv(paletteLoc,256,glColorPaletteArray,0);
but it complains about expecting a 1D array (found float[][] expecting float[]).
The shader is expecting a vec3 uniform, ie
uniform vec3 palette[256];
so I need to keep the 2D array so the RGB components are separate floats.
What is the secret to getting the 2D array passed correctly to the GLES shader so I can then access the RGB values in the shader by using
int red = palette[100].r;