   Slow programs
  So, I've been working on a game for a while now, and something has been troubling me. My game involves drawing a lot of cubes, so, a lot of quads, but not an outrageous amount. If I were drawing every surface, then a fully-filled game map would draw 196608 quads per frame, so I used hidden surfaces, since the cubes were aligned to a grid, but that was still becoming slow as the map became more complex, so I switched from glBegin() to using VBOs, and I got some speed from that, but now I'm still seeing hitches when I update the game grid. I feel like I'm doing something wrong, because the computers that I'm testing this on can still run games like Team Fortress 2, albeit at low settings.   
Quote:Original post by CyndarSo, I've been working on a game for a while now, and something has been troubling me. My game involves drawing a lot of cubes, so, a lot of quads, but not an outrageous amount. If I were drawing every surface, then a fully-filled game map would draw 196608 quads per frame, so I used hidden surfaces, since the cubes were aligned to a grid, but that was still becoming slow as the map became more complex, so I switched from glBegin() to using VBOs, and I got some speed from that, but now I'm still seeing hitches when I update the game grid. I feel like I'm doing something wrong, because the computers that I'm testing this on can still run games like Team Fortress 2, albeit at low settings.Are you doing something fairly expensive such as changing texture frequently or some other state change ? (If you for example bind a texture once for each quad or cube you draw things are gonna get alot slower than necessary)Also, are the "hitches" only when you update the game grid ? , and if so, what exactly are you doing when you update it ? (Changing existing VBOs is expensive and should be avoided, use transformations and scaling to render the same vbo in different positions and sizes if needed)   ;  Sorry it took so long for me to answer.I've optimized my program a lot, removed unnecessary state changes and the like, and I found out that my program is drawing at a more than acceptable speed. Now, I realize, the problem is updating. I switched from VBOs to regular Vertex Arrays, as the geometry is too dynamic, but I'm still getting hitches whenever I update. I've even restricted how much is being updated at once, about only one eighth of the scene (and only that which has changed) is updated per frame.   ;  What's in like when you build a release build with optimizations on?