- How should I set-up my various matrices for Orthographic projection?
Your goal is 2D, right? So you don't need any projection. Projection is the act of condensing a 3D world to a 2D plane. Set the shader so it defaults the Z coordinate of every vertex to 0.0
and you should be set.
You might use a scale matrix for the X and Y coordinates though. Scaling it so -10.0
to 10.0
becomes -1.0
to 1.0
. For references sake, the matrix to do that is:
0.1 0.0 0.0
0.0 0.1 0.0
0.0 0.0 1.0
- Are shaders as heavily used in 2D applications as in 3D ones? If so, what is their purpose in the 2D setting?
They can be. They can still be used for Per-Pixel lighting, giving some fake depth to objects. They can also be used for texture effects, water effects, image-generation... you could even use them to do physics calculations with a bit of trickery.
Another way to put that is: Everything they are used for in 3D. It's just applied differently, and isn't as well documented. Though the people playing 2D games probably aren't going to be getting on your case if you don't have lifelike effects, so they're not required either.
Though you're going to need to know the basics of shaders to render a sprite anyway.
- How should I handle the massive number of textures obviously required for a 2D game?
Just as you do in 3D. Bunches of Texture Objects, PBO's, and a Texture Atlas or a few. Probably a few structures/classes, and headaches as-well. I think that would be called "Asset Management", or something similar.
- How can I get started with 2D gamedev?
There are probably a few tutorials out there. Though, since the 3D version is more common, I would say to learn OpenGL for 3D and then apply what you learn to it's 2D counterpart. 3D and 2D are very similar, 2D just doesn't keep track of the Z coordinate.