Backface culling

Before the scene is rendered, polygons (or parts of polygons) which will not be visibile in the final scene. Three type of polygon removal are required;

  1. Removing backfaces (faces turned away from the camera)
  2. Clipping faces against the view volume
  3. Remove faces or parts of faces that are hidden behind other parts of the model (hidden surface problem).

This page examines the first type of polygon removal (backface culling).

Backface Culling

We need to traverse the model and check each polygon to see if it is visible. For each face of an object we can calculate the 'outward' normal by normalizing the cross product of two non-collinear vectors lying on the polygon face. Alternatively, we can use Newell's method to calculate the face normal. This method works for non-planar polygons and we do not need to test for collinarity. Graphics Gems III, David Kirk (editor), Academic Press, 1992, ISBN: 0124096735

\parstyle\begin{eqnarray*} \vec{\mathbf{n}}=|\vec{\mathbf{a}} \times \vec{\mathbf{b}}| \end{eqnarray*}

Determining Backface

Once the outward normal has been calculated, we need to choose any point \vec{\mathbf{q}} on the face.

Determining a Backface

We are interested in the angle \theta, between the vector (\vec{\mathbf{e}}-\vec{\mathbf{q}}) and the normal vector \vec{\mathbf{n}} (figure below). If this angle is greater than 90^{\circ}, then the face is a backface (the face is oriented away from the eye). We can perform this test with a simple dot product, the dot product of two vectors is related to the angle between them. A face is a backface if the following holds true:

\parstyle\begin{eqnarray*} \vec{\mathbf{n}}.(\vec{\mathbf{e}}-\vec{\mathbf{q}})<0 \end{eqnarray*}

If this expression is zero then the face lies parallel to the line of sight and is therefore visible.

We can now process the model to remove the backfaces, typically removing backfaces will halve the number of polygons to involved in further processing.

caption