Jump to content
  • Advertisement
Sign in to follow this  
Ingrater

VBO data alignment

This topic is 4130 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!