I have a vertex struct that has 5 glm::vec3 but some of my objects only use 2 or 3 of those members. So I have two questions :
1.) What happens to the large buffer I create, even though I don't use all the data.
Struct Vertex {
glm::vec3 pos, color, UV, normal, tangent
};
std::vector<Vertex> vertices; // will store the vertex data
glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(Vertex), vertices.data(), GL_STATIC_DRAW);
That creates a buffer that is larger than needs to be. Is the additional buffer data not send?
2.) If I send empty data to the buffers, is it causing any performance issues?
glVertexPointer(2, 3 , GL_FLOAT, GL_FALSE, size of(Vertex), reinterpret_cast<GLvoid*>(Offsetof(Vertex, unusedData));
Thanks for the information!