
Sebastian Sylvan wrote:
So if performance does matter you recommend avoiding framebuffer operations in general? I am thinking about how to display a clickable UI in front of a 3D scene and, naively, I would have drawn pixmaps on top of the scene using the framebuffer. If I try to do the same using texture mapped polygons, what is the best setup/projection to make it look like a flat window like UI? How to avoid perspective and blurring effects?
Use orthogonal projection with the same width and height as your resolution (to make it easier to target a specific position in pixel-units) and make sure you draw your polygons so they're the exact size of the bitmap of the texture. Remember that in OpenGL (x,y)=(0,0) is situated at your lower left and not your upper left (as in, for example, windows GDI).
You can set up the projection matrix so that the origin is in the
top-left. However, this will result in a negative determinant, so
polygons will be "inside-out" (e.g. the front/back-facing test will be
inverted).
--
Glynn Clements