I need this in my shader
Code :attribute vec4 weight; attribute vec4 index;
through this,
Code :glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, bufferId); glVertexAttribPointer(weightLoc, 4, GL_FLOAT, GL_FALSE, 8, reinterpret_cast<const GLvoid*>( offsetof(structName, weight))); glEnableVertexAttribArray(weightLoc); glVertexAttribPointer(indexLoc, 4, GL_FLOAT, GL_FALSE, 8, reinterpret_cast<const GLvoid*>( offsetof(structName, index))); glEnableVertexAttribArray(indexLoc);
Code :struct structName { float weight; int 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!