Headache with glVertexAttribPointer
I need this in my shader
attribute vec4 weight;
attribute vec4 index;
glVertexAttribPointer(weightLoc, 4, GL_FLOAT, GL_FALSE, 8, reinterpret_cast<const GLvoid*>( offsetof(structName, weight)));
glVertexAttribPointer(indexLoc, 4, GL_FLOAT, GL_FALSE, 8, reinterpret_cast<const GLvoid*>( offsetof(structName, index)));
How can I get it to send 4 floats as 1 vec4, when my data are apart? They are structured such that there are an array of 4 of structName, if you get what I mean. Setting the stride by 8 or 32 doesn't seem to work.. I already have them buffered to the GPU with rows of 4 structName.
Any help is appreciated!