Let me start by reviewing the original plan: it is shown in Listing 1. This procedure traverses through all elements, calculates and sends each vertex to OpenGL. The CPU does all the calculation work – and it does this every time the scene is rendered. To be fair, the procedure is not all bad: it uses very little memory.
But what exactly is our memory overhead? A float is 4 bytes. As shown in the previous post, a 50x50 heightmap produces 5 000 vertices (during the triangular traverse). So, if we store each vertex, we would need less than 60 kb (5 000 * 3 * 4) of memory on the GPU. As a side effect: once we have the vertices on the GPU memory, we do not have to make the 5 000 calls o OpenGL. And voila, we gain a lot of speed!