VBO Altering
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?
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.
Create your VBO with the GL_WRITE_ONLY flag.
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?
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.
Perhaps the in main thread you can do something else at the same time. It would be a win on dual core.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement