The Vbos upload looks alright to me, but there still might be something wrong somewhere :whistle:
My Vbos initialization looks like this :
glGenBuffers(1, &m_positionsBufferId);
glGenBuffers(1, &m_normalsBufferId);
glGenBuffers(1, &m_texCoordsBufferId);
glGenBuffers(1, &m_tangentsBufferId);
glGenBuffers(1, &m_binormalsBufferId);
glGenBuffers(1, &m_indexesBufferId);
glBindBuffer(GL_ARRAY_BUFFER, m_positionsBufferId);
glBufferData(GL_ARRAY_BUFFER, m_positionsVector.size() * sizeof(GLfloat), &m_positionsVector.front(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, m_normalsBufferId);
glBufferData(GL_ARRAY_BUFFER, m_normalsVector.size() * sizeof(GLfloat), &m_normalsVector.front(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, m_texCoordsBufferId);
glBufferData(GL_ARRAY_BUFFER, m_texCoordsVector.size() * sizeof(GLfloat), &m_texCoordsVector.front(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, m_tangentsBufferId);
glBufferData(GL_ARRAY_BUFFER, m_tangentsVector.size() * sizeof(GLfloat), &m_tangentsVector.front(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, m_binormalsBufferId);
glBufferData(GL_ARRAY_BUFFER, m_binormalsVector.size() * sizeof(GLfloat), &m_binormalsVector.front(), GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexesBufferId);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, m_indexesVector.size() * sizeof(GLuint), &m_indexesVector.front(), GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
And the Vbos drawing :
m_shader->Enable();
// ...
// Send uniforms to shader
//
GLuint positionsAttribLocation = 0;
GLuint normalsAttribLocation = 0;
GLuint texCoordsAttribLocation = 0;
GLuint tangentsAttribLocation = 0;
GLuint binormalsAttribLocation = 0;
positionsAttribLocation = m_shader->GetAttribLocation("in_vPosition");
glEnableVertexAttribArray(positionsAttribLocation);
glBindBuffer(GL_ARRAY_BUFFER, m_positionsBufferId);
glVertexAttribPointer(positionsAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, NULL);
normalsAttribLocation = m_shader->GetAttribLocation("in_vNormal");
glEnableVertexAttribArray(normalsAttribLocation);
glBindBuffer(GL_ARRAY_BUFFER, m_normalsBufferId);
glVertexAttribPointer(normalsAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, NULL);
texCoordsAttribLocation = m_shader->GetAttribLocation("in_vTexCoord");
glEnableVertexAttribArray(texCoordsAttribLocation);
glBindBuffer(GL_ARRAY_BUFFER, m_texCoordsBufferId);
glVertexAttribPointer(texCoordsAttribLocation, 2, GL_FLOAT, GL_FALSE, 0, NULL);
tangentsAttribLocation = m_shader->GetAttribLocation("in_vTangent");
glEnableVertexAttribArray(tangentsAttribLocation);
glBindBuffer(GL_ARRAY_BUFFER, m_tangentsBufferId);
glVertexAttribPointer(tangentsAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, NULL);
binormalsAttribLocation = m_shader->GetAttribLocation("in_vBinormal");
glEnableVertexAttribArray(binormalsAttribLocation);
glBindBuffer(GL_ARRAY_BUFFER, m_binormalsBufferId);
glVertexAttribPointer(binormalsAttribLocation, 3, GL_FLOAT, GL_FALSE, 0, NULL);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_indexesBufferId);
glDrawElements(GL_TRIANGLES, 3 * m_trianglesCount, GL_UNSIGNED_INT, 0);
glDisableVertexAttribArray(positionsAttribLocation);
glDisableVertexAttribArray(normalsAttribLocation);
glDisableVertexAttribArray(texCoordsAttribLocation);
glDisableVertexAttribArray(tangentsAttribLocation);
glDisableVertexAttribArray(binormalsAttribLocation);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
m_shader->Disable();