Full Screen Quad

Some graphical operations require computations to be done on every pixel on the image plane. Any post processing steps and image filter operations in particular are typical examples. Therefor a rendering step is necessary that does not consider specific geometry but makes sure that every pixel is involved. A simple quad (rectangle) entirely covering the viewport is thus an intuitive possibility to touch every pixel in rendering while making visibility determination of hidden faces etc. inevitable.

There are different possibilities to render a full screen quad:

  1. Using orthographic projection
  2. Using perspective projection

If an orthographic projection is used, the quad should just match the 4 corners of the defined viewport in x and y direction while the depth can be arbitrary.

Example in OpenGL:

//reset projectionmatrix
glMatrixMode( GL_PROJECTION );

//set orthographic projection
glOrtho( -1, 1, -1, 1, 1.0, 40.0 );

//set matrixtransformation to identity – ensures that no
//transformation is applied to the geometry (quad)

glMatrixMode( GL_MODELVIEW );

glViewport( 0, 0, 1024, 768);
glClearColor(1.0, 1.0, 1.0, 1.0);

//define geometry – full screen quad (depth at -1.0 : view direction is always with negative z-axis in OpenGL!)
glNormal3f(0.0, 0.0, 1.0);
glVertex3f(-1.0, 1.0, -1.0);
glVertex3f(1.0, 1.0, -1.0);
glVertex3f(1.0, -1.0, -1.0);
glVertex3f(-1.0, -1.0, -1.0);

Using an perspective projection the corners of the quad should be defined on the 4 projection rays originating at center of projection (camera) and intersecting the 4 corners of the view frustum (these rays form the edges of the view frustum). The simplest method in this case is to simply match the image plane with the quad. Otherwise the definition is more difficult, as one has to consider perspective distortion when defining the corners of the quad.

The depth test can generally be disabled for a full screen quad pass.