[basic 2d] Vertex buffer, batching and atlas,
Members - Reputation: 110
Posted 15 September 2012 - 11:07 PM
I'm a very beginner in dx programming, I'm working on a basic 2d graphics engine (D3D11). I was reading some books, articles, tutorials and I managed to setup the basic, I can draw a sprite, move it around scale etc.
Now I need to go deeper and I need to render multiple sprites, multiple textures etc.
I have one vertex buffer and one texture for my demo sprite, I read and I have been told that the best way to handle 2d is using sprite batching and texture atlas.
I did some researches but I honestly couldn't figure this out.
How does batching work exactly? I know that texture atlas is basically multiple images on one big texture but how do I relate this with vertices? Do I have to create a huge vertex buffer that can hold something like 100 quads and every frame move these quads around and remap their texture and call one single draw call for this huge buffer? Or do I only need one big quad? How does it work exactly?
What are the exact steps I should perform each frame?
Thank you for your time and for your help!
Note: I posted here and not on the graphics forum because I believe my question is a pretty beginner one!