What are the pros and cons for using strided vertex buffers vs tighly packed buffers for each attribute? What I mean is for instance:
Stride: xyzrgb xyzrgb xyzrgb
Tight: xyzxyzxyz rgbrgbrgb
At first glance it might look like you easily can change the size when using stride, but the content of the vertex buffer is deleted when you reallocate it with glBufferData()
.
For me it seems best to use the tight model since position, color, and texcoords might come from different arrays in the local memory and because there is no strided buffer data function; you must copy all the arrays into an interleaved buffer before uploading or use one glBufferSubData()
per vertex per attribute (terrible idea I guess).
There seems to be common practice to use interleaved buffer (stride). Why is that? Anything I am missing here?