Batching dynamic sprites in OpenGL
Posted
by
Aaron
on Game Development
See other posts from Game Development
or by Aaron
Published on 2012-12-02T20:46:18Z
Indexed on
2012/12/02
23:27 UTC
Read the original article
Hit count: 274
I'm trying to wrap my head around how batching is done in a 2D sprite-based game. My understanding is I'd get the vertices that represent each sprite I want to draw and stuff them all into a single mesh. That way I'd only need a single draw call to render everything.
Does this apply when the sprites I render are different between frames, or when some sprites are moving? Because it sounds like I'd then have to recreate my batch mesh each frame, using either glDrawArrays
/glDrawElements
or a streaming VBO I assume. Does this sound correct?
© Game Development or respective owner