Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

moshon

vbo - basic questions

This topic is 5276 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

hi, guys. I have somw questions about vbo''s 1) I need to load the vertexes one at a time into the vbo (because I''m using buffer of indexes to another buffer of vertexes) : how can I do it? 2) How can I manage to handle with diffrent objects : is there a start point and a end point in the vbo it self or something like that, how do I load diffrent objects? 3) is it meeter (for performance or something else) if I use 3 array (1 for vertex, 1 for textures cordinate and 1 for normals) or if I use them in only 1 array? thanks alot for your help.

Share this post


Link to post
Share on other sites
Advertisement
ad 1) There are basically two ways of getting data into a buffer. One is to map the VBO into memory and then write our vertex/normal/texture data to the returned memory region. The other (and apparently "better") way is to prepare a "normal" data buffer, write your data there and then write it to the VBO with glBufferDataARB et al.

ad 2) VBOs are effectively used like normal vertex arrays. You bind them and then use standard glVertexPointer, glNormalPointer, ... calls (with 0 as the pointer location) and then use glDrawArrays to actually do something.

ad 3) I don''t think stuffing all data together would bring any relevant performance difference. I haven''t played with that stuff that much tho. At least, keeping the data separate should make your code a bit easier to understand and maintain.

Share this post


Link to post
Share on other sites
thanks.

can you please cearify the first answear ? map the vbo... return memory region...? what does it mean?
how can I load vertexes into memory one at a time.

Share this post


Link to post
Share on other sites

  • 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!