Minecraft Java Edition – What Is the ‘Use VBOs’ Setting?

minecraft-java-edition

In the 14w29b snapshot there is a new option in the "Video Settings" menu called "Use VBOs":

enter image description here

The snapshot update says that enabling "Vertex Buffer Objects" should increase your FPS by 5% to 10% on average.

I am looking for a simple explanation of what VBOs do visually and how they work.

Best Answer

The answer provided by Flaunting is correct, but in case anyone is interested why it might be more efficient, here is an explanation.

In immediate mode (I think this is the default case in minecraft) when you want to render say a square:

Unit square

You would issue the following commands each frame (in pseudo code)

begin drawing
draw line from (0,0) to (1,0)
draw line from (1,0) to (1,1)
draw line from (1,1) to (0,1)
draw line from (0,1) to (0,0)
end drawing

For one square, this is not a lot, but there could be millions of vertices in a scene, and they may have more attributes (colour, normal etc.). This is a lot of data to send to the GPU each frame.

Using VBOS, you would load all of the vertex data into GPU memory at the start. Pseudo code might look like this:

create VBO
load (0,0) into VBO
load (1,0) into VBO
load (1,1) into VBO
load (0,1) into VBO
load (0,0) into VBO

The OpenGL code will give you back a 'name' for this VBO (a non-zero unsigned integer iirc). You can then reference this when you want to draw the square. So each frame, you only need to issue one draw command:

draw vertices in VBO

You may have to set up the drawing state so that it uses pairs of vertices for lines, but for each additional VBO, you only require one extra draw call. In fact, for static level geometry (probably not applicable in the case of minecraft) you can combine all of these vertices into one massive VBO, if you have enough GPU memory.

I'm surprised that the speed-up is only 5-10%. This is probably because of the dynamic level geometry.