Best way to handle vertices in OpenGL? C ++

I am implementing a map renderer for Quake. I am currently browsing vertex arrays and submitting them one at a time. I was told that using vertex arrays I can significantly speed up the rendering process by sending vertices to the package. Now I just looked at the display lists and finally the VBO objects or vertex buffers. VBO mentions a great advantage regarding the communication between the client and the server. IF I only plan to develop a client, not a server, is VBO still applicable to what I do?

What games are currently used in the OpenGL spectrum for fast vertex processing?

+7
source share
2 answers

When they say "client / server", they do not talk about the Internet network.

  • Client = CPU
  • Server = GFX Hardware

These are two separate pieces of hardware. Although they are (usually) attached to the same motherboard, they still need to communicate with each other. Typically, the graphics card does not have access to the main memory of your motherboard, so the vertices (and textures, indices, etc.) should actually be sent to the graphics device.

Story: use vertex buffer objects. For static data (like Quake maps) there is nothing better. The vertices are sent to the graphics device (server) once and remain there. When you draw a version of a vertex by vertex (using something like glBegin(GL_TRIANGLES) ), the vertices are sent through each frame, which, as you can imagine, is pretty inefficient.

+10
source

VBOs are a modern answer.

You should not understand the concepts of "client" and "server" in the sense of OpenGL. This is not the difference between Apache (HTTP server) and Chrome (HTTP client, by the way). In OpenGL terms, the client is you / your code. Server is a graphics driver / hardware.

VBOs allow you to store information about the vertices on the graphic equipment, which avoids sending each vertex to the map every time you use it. This is a huge advantage.

You ask about vertex processing, but to answer your question, we will need to clarify what you had in mind. If you mean getting the vertices on the video card, then the answer will be VBOs. If we are talking about manipulating vertex data, this can be effectively achieved using Shaders .

+3
source

All Articles