Sign in to follow this  
1Bad

VBO Altering

Recommended Posts

Hey, so I am considering various options for storing an rendering planetary terrain. One way which I have considered is storing all the vertices in one VBO and using the glMapBuffer() function to incrementally add and remove vertices from the buffer as I need them. However, I am unsure of the performance of the glMapBuffer function. I wish to only update specific vertecies in the buffer, I know the index and all. I do not want to have to update the entire buffer or have to transfer the entire buffer from graphics memory to system memory either to make this alteration. What are the choices I have when I want to modify a large buffer and make only small alterations to it in an efficient manner?

Share this post


Link to post
Share on other sites
For best performance, it is best to double buffer your VBO, that means having 2 VBOs and using them interchangeably. It is also best to update the entire VBO.
Create your VBO with the GL_WRITE_ONLY flag.

Share this post


Link to post
Share on other sites
So this would require some multithreading to make double buffering efficient. From what I have read using mapping the buffer means that the entire buffer needs to be recopied onto the card after unmap is called. Is the speed of this transfer such that it would not noticably effect performance if I wanted to make incremental changes to a very large buffer?

Share this post


Link to post
Share on other sites
I don't see why it would require multithreading. Don't make your VBO gigantic. Make it 1 or 4 MB. If it would take to much time to update the VBO because you do CPU work, then go ahead, do it in another thread.
Perhaps the in main thread you can do something else at the same time. It would be a win on dual core.

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