(follow up)
Below is the test setup for a user-defined attribute in gemvertexbuffer.cpp:
(m_shader is the 5th vbo for test, attribute index is set to 0)
(just for this test I have set the program parameter in "glBindAttribLocation" to "1" because of this output when a glsl_program is linked with vert/frag shaders for the first time:
"[glsl_program]: linked shaders 4 2: 1")
code:
if(m_shader.render()) {
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, 0); // index, size, etc etc
glEnableVertexAttribArray(0); // index
glBindAttribLocation(1, 0, "gemAttrib1"); // program, index, attribute
}
I use "gemAttrib1" to set the fragColor but it's not working.
vert file:
attribute vec4 gemAttrib1;
varying vec4 color1;
void main()
{
color1 = gemAttrib1;
gl_Position = ftransform();
}
frag file:
varying vec4 color1;
void main()
{
gl_FragColor = color1;
}