ArticleslgStudy

computer science

Back-face culling

Back-face culling is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Back-face culling rather than just read about it. In short: In computer graphics, back-face culling determines whether a polygon that is part of a solid needs to be drawn. Polygons that face away from the viewer do not need to be drawn, as they will be obscured by other polygons facing the viewer.

Back-face culling — main illustration
Back-face culling — illustration

Key takeaways

  • Back-face culling belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Back-face culling to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Back-face culling from memory before moving on to harder problems.

Reference excerpt

In computer graphics, back-face culling determines whether a polygon that is part of a solid needs to be drawn. Polygons that face away from the viewer do not need to be drawn, as they will be obscured by other polygons facing the viewer. This process makes rendering objects quicker and more efficient by reducing the number of polygons to be drawn. For example, in a city street scene, there is generally no need to draw the polygons on the sides of the buildings facing away from the camera; they are completely occluded by the sides facing the camera. If multiple surfaces face towards the camera, then additional use of methods such as Z-buffering or the painter's algorithm may be necessary to ensure the correct surface is rendered. Back-face culling is typically quite a cheap test, only requiring a dot product to be calculated, and so it is often used as a step in the graphical pipeline that reduces the number of surfaces that need to be considered. In general, back-face culling can be assumed to produce no visible artifact in a rendered scene if it contains only closed and opaque geometry. In scenes containing transparent polygons, rear-facing polygons may become visible through the process of alpha composition. Back-face culling may also be applied to other problems. For example, in wire-frame rendering, back-face culling can be used to partially address the problem of hidden-line removal, but only for closed convex geometry. Back-face culling can also be applied to flat surfaces other than polygons, for example disks, which have a constant normal vector or extended to patches where the surface normal can be bounded. A related technique is clipping, which determines whether polygons are within the camera's field of view at all. As clipping is usually more expensive than back-face culling, back-face culling is often applied first. Another similar technique is Z-culling, also known as occlusion culling, which attempts to skip the drawing of polygons that are covered from the viewpoint by other visible polygons. In non-realistic renders, certain faces can be culled by whether or not they are visible, rather than facing away from the camera. "Inverted hull" or "front face culling" can be used to simulate outlines or toon shaders without post-processing effects.

History Back-face culling has been used since at least the 1970s. It has been used in many video games, including the original 1984 BBC Micro version of the game Elite. By the mid 1990s, many graphics systems could implement back-face culling in hardware.

Implementation One method of implementing back-face culling is by discarding all polygons where the dot product of their outward pointing surface normal, N, and the line of sight vector, L, is greater than or equal to zero:

L⋅N≥0 In the case of rendering a polygon specified by a list of vertices, this might be calculated by

(V0−P)⋅N≥0 where P is the view point, V0 is the first vertex of a triangle and N could be calculated as a cross product of two vectors representing sides of the triangle adjacent to V0

N=(V2−V0)×(V1−V0) Since cross product is anticommutative, defining the normal in terms of cross product means that the normal direction is dependent on the vertex order (winding):

(V1−V0)×(V2−V0)=−(V2−V0)×(V1−V0) Consequently, the vertex ordering is usually chosen such that front-facing triangles have clockwise winding, N defined as above is the normal directed outward from the object. In this setup, back-face may be regarded as a test of whether the points in the polygon appear in clockwise or counter-clockwise order when projected onto the screen. If the user has specified that front-facing polygons have a clockwise winding, but the polygon projected on the screen has a counter-clockwise winding then it has been rotated to face away from the camera and will not be drawn. If the points are already in view space, P can be assumed to be (0, 0, 0), the origin, simplifying the above inequality:

V0⋅N≥0 It is also possible to use this method in projection space by representing the above inequality as a determinant of a matrix and applying the projection matrix to it. Another method exists based on reflection parity, which is more appropriate for two dimensions where the surface normal cannot be computed (also known as CCW check). Let a unit triangle in two dimensions (homogeneous coordinates) be defined as

U0=[001],U1=[101],U2=[011] Then for some other triangle, also in two dimensions,

V0=[x0y01],V1=[x1y11],V2=[x2y21] define a matrix that transforms the unit triangle:

M=[x1−x0x2−x0x0y1−y0y2−y0y0001] so that:

MU0=V0 MU1=V1 MU2=V2 Discard the triangle if matrix M contained an odd number of reflections (facing the opposite way of the unit triangle)

|M|<0 The unit triangle is used as a reference and transformation M is used as a trace to tell if vertex order is different between two triangles. The only way vertex order can change in two dimensions is by reflection. Reflection is an example of involutory function (with respect to vertex order), therefore an even number of reflections will leave the triangle facing the same side, as if no reflections were applied at all. An odd number of reflections will leave the triangle facing the other side, as if exactly after one reflection. Transformations containing an odd number of reflections always have a negative scaling factor, likewise, the scaling factor is positive if there are no reflections or even a number of them. The scaling factor of a transformation is computed by determinant of its matrix.

References

Illustrations

Back-face culling: On the left a model without back-face culling; on the right the same model with back-faces removed. Because the polygons do not form a closed solid, differences can be seen.
On the left a model without back-face culling; on the right the same model with back-faces removed. Because the polygons do not form a closed solid, differences can be seen.

Worked examples

Example 1 — a first encounter with Back-face culling

Start with the simplest possible case. Write down what Back-face culling claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Back-face culling before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Back-face culling ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Back-face culling

In research
Back-face culling appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Back-face culling in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Back-face culling is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D rendering, Computer graphics algorithms, so understanding it makes those chapters shorter.
In everyday life
Look for Back-face culling outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Back-face culling” →

How to study Back-face culling in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Back-face culling means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Back-face culling out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Back-face culling in simple terms?

In computer graphics, back-face culling determines whether a polygon that is part of a solid needs to be drawn. Polygons that face away from the viewer do not need to be drawn, as they will be obscured by other polygons facing the viewer.

Why does Back-face culling matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Back-face culling?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Back-face culling.

Tags

  • 3D rendering
  • Computer graphics algorithms

Keep exploring