hi
I’m currently implementing custom vertex attributes. Are there any examples or documents about that? I didn’t find any complete ones.
The problem is, that only one attribute array is accessable in the GLSL vertex shader fixed at index 1. And it doesn’t make a difference to what attribute variable of the vertex shader I bind the attribute index or if I even do the binding.
My vertex shader looks like this:
attribute vec3 customAttrib;
attribute vec3 customAttrib2;
attribute vec3 customAttrib3;
void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
gl_FrontColor = vec4( customAttrib.x, customAttrib.y, customAttrib.z, 0 );
}
It makes absolutely no difference, if I use customAttrib, customAttrib2 or customAttrib3 for gl_FrontColor. They all contain the values of the first vertex attribute and only, if I bind it to attribute index 1. No other index works.
I bind the vertex attribute array with this code:
GL20.glBindAttribLocation( shaderProgramHandle, 1, byteBufferContainingTheAttribName );
GL20.glEnableVertexAttribArray( 1 );
GL20.glVertexAttribPointer( 1, 3, false, 0, dataBuffer );
Any thoughts? Please ask, if I missed to provide some important information.
Marvin