"centers" is a FloatBuffer the same size as the vertexBuffer.
I'm getting the following error:
org.lwjgl.opengl.OpenGLException: Invalid value (1281)
at com.jme.renderer.lwjgl.LWJGLRenderer.displayBackBuffer(Unknown Source)
setAttributePointer(String var, int size, boolean normalized, int stride, FloatBuffer data)
size of 3 might be right in your case but a stride of 0 sounds scary...just found from a post that that's the way renanse did in a glsltest post here though...
so.setAttributePointer("Tangent", 3, true, 0, data); dunno how that works...
As a workaround i pass data instead of color, for now. By looking into source of relinkProgram, it does not set the actual data pointers, only links opengl id numbers with string names. The actual passing of data is in apply of glsl renderstate. What i miss is putting the data on the graphics card as VBO. After searching the opengl docs, it seems that there is no command for putting glsl attribute arrays into VBO like vertex/normal/color/tex arrays. I'm not sure, but i guess that the attribute array is passed each time the pointer changes. And using relinkProgram each time when switching to another model drastically reduces frame rate. Another option would be loading/compiling/linking a shader for each model separately.
It seems that passing attribute data in gl_Color is a good option, if vertex color is not needed.