iam using COLLADA for loading 3D assets, and i want to interlace position, normal and texcoord data into one array of struct and use vertex index to draw the object, however the vertex attributes are of different count (ex: position has 24 values, normals have 36 values ..etc), i was able to load models by rearranging the attributes into the predefined struct array, however this time i have to load models without using the index buffer, is it possible to interlace those attributes into one array and use index buffer? what is the best approach to load models that would give the best performance gain.
my struct would look like this
struct vertexAttribs
{
glm::vec3 position;
glm::vec3 normals;
glm::vec2 texCoord;
}
using an index buffer is a all or nothing deal. Either all attributes use the index buffer or no attributes use it.
You would have a VkVertexInputBindingDescription
with stride = sizeof(vertexAttribs)
and a VkVertexInputAttributeDescription
for each attribute in it with matching offset
s and format
s using the same binding
as the VkVertexInputBindingDescription
.