Batch Rendering
Ver en español Switch to English The first renderer worked. It opened a window, drew a quad with a texture, and that was honestly enough to feel good about for a day. Then I started thinking about what it would take to draw a hundred quads — and realized I had a problem. El primer renderer funcionaba. Abría una ventana, dibujaba un quad con textura, y con eso era suficiente para sentirse bien por un día. Después empecé a pensar en lo que haría falta para dibujar cien quads — y me di cuenta de que tenía un problema. The cost of one draw call per object Every draw call has overhead. When you tell the GPU to draw something, the driver has to validate state, pack commands, and synchronize with the GPU — and that work happens every single time you call it. For a handful of objects you’ll never notice. For a 2D scene with hundreds of sprites animating at once, calling glDrawElements per sprite is a fast way to tank your framerate. ...