Hello,
I have been working on a voxel engine for terrain, similar to mine craft. Online there are many tutorials about this. One of the optimizations that is frequently discussed involves separating the VBO’s into collections of faces that all point in the same direction. Then you only draw the VBOs with faces that would actually be visible.
So, a cube has 6 faces. If the camera is to the left of the cube, there is no need to even draw the right-facing face. When you are talking about thousands of cubes, it would seem to make sense to have 6 different VBO’s, one for each direction. So if the camera is to the left, you only draw the vbo containing left-facing faces, and not the right-facing vbo.
In practice, however, I am finding that my engine is much faster if I do NOT do this. That is, my engine runs at 48 fps if I put all the faces into one VBO and draw the whole thing every frame, letting openGL do the culling. If I have 6 different VBOs, calling glBindVertexArray to switch between the ones that need drawing, my framerate drops to around 38.
I was just wondering why that would be? In fact, with my polygons split into 6 different VBO’s, the framerate stays around 38 whether or not I do the test. So if I do the test, I only need to draw 3 of the 6 VBO’s. But the frame rate is 38. If I comment out the test, leaving the 6 VBO’s and drawing all 6, the rate is still around 38. I don’t really seem to save any time by not sending half my polygons!? Anyone know why I might not be seeing any savings there?
Thanks,
Bob