Skip to main content
gamedev.net
🔒 Locked

vbo - basic questions

Started by moshon Jun 7, 2004 at 7:40 AM 1 replies 750+ views
Original Post
moshon
moshon
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.
Shadowdancer
Shadowdancer
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.
moshon
moshon
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.

Topic Locked

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

Sign in to reply to this topic.