Sign in to follow this  
Ingrater

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 this post


Link to post
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"

No idea. You can ask nVidia or ATI about that.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this