Hey, I'm working on a minecraft-like voxel engine. I keep my block type information in chunks, before creating vectors, and then sending that information off into the GPU as a vbo. This was working fine, but after generating too many different vbo objects (well the pointer that you bind, with the buffer), the game kept crashing. I ignored this for a while, but i've fixed all my other bugs on my list, and this one needs to be addressed.In order to solve it, I tried running the game without drawing the VBOs, and it didn't crash after alot of time. So from this, I figured having too many vbos was the problem, then I read various things, and people seemed to agree on reducing the calls to bindBuffer, or shoving all your objects(Th into one vbo (ideally) before sending it off. The render information is static, so this shouldn't be too difficult.In order to solve it, I used indexes, and created just one vboPointer, then for every chunk I had, I just generated it in one of the indexes at a time. There can be anywhere from 30 to 1000 chunks loaded depending on the renderDistance.Also deleting the buffers seemed to cause it to crash too. So after some research, I figured this was because it releases the buffer position for any future use. I think I tried generating it again, and had no luck.I would like some clarity on vbo useage, do vbo indexes work for large numbers? Has uanyone had the bg where multiple vbo objects don't work? What should be the best approach for this? Minecraft uses display lists, but don't vbos give a performance boost?Also, I heard the calls to bindBuffer will take a fair amount of processing, so is it better to bind these on a thread to completely reduce loading times?One possible solution is too use not one vbo per chunk (16x16x16 blocks), or one for all of them, but one per X-Z position or something like that. But it's very hard to debug vbo errors when I can't understand the problem. Feels like i'm just trying anything, not making any progress on this.

Attached Thumbnails

you may get better FPS by not using indices, or by super-optimizing indices which may be a waste of timedeleting VBOs is completely safe, and completely necessary to keep from using too much vramconsider using columns of the entire world as a final VBO, then you will have let's say 32x32 VBOs, and you need only bind a few of them for each renderin minecraft 32x32 sectors x 16x16 blocks is the size of the world on "far render distance" settingremember that the memory requirement for the game increases exponentially with each ring of sectorsyou also need to parallellize the pipeline that assembles the world into vbo databut you can only call gl* functions on the render threadithat means that it's pointless to try to parallellize anything in the renderer, and instead focusing on optimizing hard on what the renderer has to doand lift some weight off of itideally, the rendering thread should only do rendering, and nothing else =)you can only call gl* functions from the same thread as the opengl context was created on, otherwise you are in trouble

you can use occlusion query objects to find out what isnt visible 1 frame from when you render themthis will let you draw alot less 1 frame after drawing everything in the frustum

Ahh thank you for your advice! It's very spefic to what I needed. Before reading this I already took the initiative to put the rendering just on one single thread, this seemed to improve it alot, ie it crashes less.
What do you mean by super-optimizing indices?
I put all my chunks into one single vbo, using indexes to the pointer array. Is it necessary to use sectors of vbos rather then just one?
Yeah I read that its no use as opengl doesnt work well with threading 'that means that it's pointless to try to parallellize anything in the renderer, and instead focusing on optimizing hard on what the renderer has to do and lift some weight off of it'!
I'm curious as too the occlusion, but that would require alot of updates to the vbos, is this what minecraft does? How it says chunk updates in its debug gui? Is it because it uses cpu useage and causes opengl to render less things, thus improving fps... It's just the calls of glBindBuffer are very expensive for time, so implementing these things and getting better fps has been a largely trial and error thing for me.

YESS!!! I finished redoing most of my code, and putting only rendering in the main thread. I had a little bit of extra stuff in the rendering thread left, and after removing it it works the same as many other voxel like games i've been trying to make my game as smooth as. Thank you!