Skip to main content
GameDev.net gamedev.net
🔒 Locked

Interleaved Data, one VBO?

Started by GodBeastX Aug 3, 2006 at 4:20 PM 5 replies 1.4k views
Original Post
GodBeastX
GodBeastX
Alright, I'm wondering if there is performance issues from interleaving vertex data into a VBO and calling the pointer association function with strides and such? If there is a performance hit or problem with this, is there a method of associating the vertices interleaved? Is it better to separate the data into separate buffers?
V-man
V-man
It's better to interleave and that's what typically is done.
Typically, people put vertex first, then other stuff. The exact position doesn't matter. Something like
x y z nx ny nz s t x y z nx ny nz s t ...
GodBeastX
GodBeastX
Thanks, I was curious about this :) I'm porting some D3D code I wrote and I didnt feel like having separate buffers for all the vertex info.
rick_appleton
rick_appleton
In immediate mode, passing in a vertex position signals vertex complete. I also believe that when using vertex arrays, the setting of glVertexPointer signals some kind of completeness to the driver.

For this reason, I've always thought putting the vertex position last would be beneficial. Can someone confirm/deny this?
mrMagnetic
mrMagnetic
@rick_appleton

If you look at the possible values for the 'format' parameter in glInterleavedArrays(), like GL_T2F_C4F_N3F_V3F, it seems like the 'correct' sequence would be
Texcoord Color Normal Vertex.

Don't know if it really makes a difference though.
---Current pet project: ProjectM
V-man
V-man
I think it's just a matter of pointers in the GPU, but benchmark it if you wish. I haven't seen any performance related articles say that you should put them in a particular order.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.