Quote:
Originally Posted by headkaze
Actually that's an interesting point, is it that important to have the array interleaved? Currently for my model animation system I am setting the vertex pointer for each anim frame rather than copying over the data which is obviously quicker. This means my vertex, tex coords etc. are all separate pointers to the data. But I did stumble upon an article which said to keep your vertex data in a single struct for better performance. I take it that's what you mean by interleaved? But with the iPhone sharing it's RAM and not having to transfer data to any sort of "VRAM" would it really incur a penalty?
EDIT: Found the article Interleaving Vertex Data which is where this is stated. Also for the OP who may want to look at transforming vertex data using matrices, another good article from the same site Transformations and Matricies
|
It all about spatial locality - if you are accessing positions , there is a good chance you will also access normals ( if you are doing CPU transformations) and having normals reside in some other part of memory means having potential two cache line misses as opposed to just one.
Beside your own code , the GLES driver on the iPhone walks your entire vertex stream and does some preprocessing on its own so you do want to use interleaved arrays.
PS. I am not sure I understand your point about animations and having separate vertex streams.