Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I noticed that there is quite some difference between 3D and 2D rendering using OpenGL, the techniques are different - pixel-perfect placing is a lot more desirable, among other things.

Are there any good (complete) references on using OpenGL for rendering 2D graphics? There are quite a few "tutorials" around on the net that help you open a window, set up a half-decent environment and draw a sprite, but no real good information on rotation, blending, lightning, drawing order, using the z-buffer, particles, "complex" primitives (circles, stars, cross symbols), ensuring pixel-perfect rendering, instancing and many other staple 2D effects/techniques.

Any books, great blogs, anything? Any particular awesome libraries to read?

share|improve this question

closed as primarily opinion-based by Byte56 Jul 19 '13 at 14:36

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

2 Answers 2

OpenGL 2D and 3D rendering is almost same except few things:

  • Orthographic projection instead of perspective projection. There is no problem pixel-perfect placing if your ortho has same width,height as your window have.
  • Usage of 2D vertices, unless you aren't drawing 3D things in 2D projection
  • 2D rendering is a lot of simpler 3D

Everything else is same - pipeline, shaders, texturing, buffers.

Resources you would probably like:

  • GPWiki - category OpenGL - basics about OpenGL, window creation, input,...
  • NeHe Productions - good step-by-step tutorials about OpenGL, almost everything is presented using 3D objects, but a lot of is applicable in 2D rendering
  • Lighthouse3D.com - GLSL - tutorials about OpenGL Shading Language. Like in NeHe, they are presented using 3D objects, but GLSL is usable for 2D, too. It's very easy to create nice effects with it.
share|improve this answer
5  
Most NeHe tutorials are horribly outdated, concentrating on the deprecated OpenGL 1.x and as should be given a well earned but long overdue retirement. –  Tapio Jul 1 '12 at 20:56
add comment

Have you read the OpenGL red book? Check out chapter 2 and 8.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.