I understand that VBOs are currently the best way to render polygons.
Here is what I understand VBO’s to be:
(please correct any of the following information if it is wrong)
- Vertex Buffer Objects take an array of data, package it tightly, and send it to the GPU to be rendered.
- The memory must already be reserved on the GPU before the data is sent.
- The goal of using VBOs is to keep the data stored on the GPU for as long as possible (therefore, better for static drawing?)
That being said, I have a couple of questions about them.
1) What parts of the vbo should be done only once, and which need to be called every tick?
2) What parts of the vbo fast and which parts take the most time? (when drawing thousands of polys wrongly, it will slow down to about 1fps)
Now, if somebody really feels like helping me:
3) What is the correct way to render a huge amount of polygons with VBOs in the following example:
I’m rendering a 2d environment made up of probably millions of squares (think terraria).
I have a class for each tile, and a map class that holds 1 list of tiles at the moment.
Should I store the buffer data in the tile class and call it to the map class when needed?
Should I package all of the arrays into one huge array before I send it to a VBO?
Hopefully you’ve got an idea of what I’m trying to do now.
Any information would be helpful as I’m still a newb! xD
Edit: sorry, forgot to mention that I’m using LWJGL to do this.