VBO data alignment

Recommended Posts

How should data be aranged in an vbo? Should ist be like position 1 tex_coord 1 color 1 position 2 tex_coord 2 color 2 ... or position 1 position 2 tex_coord 1 tex_coord 2 color 1 color 2 ? What happens if I use glDrawArrays inside a display list. Is the wohle data of the VBO copied and so stored twice in graphics memory or is simply the command chain saved for faster execution? Does anyone know a good article for rendering with indexed vbo's?

Share on other sites
It should be the first choice. Secondly, your vertices should be a multiple of 32 bytes, since ATI GPUs like it that way.

If you will be using VBO, display lists are essentially useless.
Some say that it's fast for nVidia because nVidia does viewport based culling but I do my own culling and I dislike display lists.

It's up to you.

"Is the wohle data of the VBO copied and so stored twice in graphics memory"

Share on other sites
Myself I align my data as such

struct Vertex{float x,y,z;float s,t;float r,g,b,a;};

Now all you have to do is get some byte offsets into that struct so the gl*Pointer()'s have a way to reference the data with the BUFFER_OFFSET() macro.

Create an account

Register a new account

• Partner Spotlight

• Forum Statistics

• Total Topics
627642
• Total Posts
2978354

• 10
• 12
• 22
• 13
• 33