152 Chapter 3 Renderers
In most circumstances, you want back-face culling to occur. If it is disabled, then
you proceed immediately to the clipping stage. If culling is enabled, the default is to
eliminate back-facing triangles. However, there are some special effects that require
front-facing triangles to be culled. For example, planar reflections need this because
the object has counterclockwise-ordered triangles to be back-face culled, but the
object’s reflection has, effectively, clockwise-ordered triangles. The
CullState class
allows you to select how you want culling to occur, if at all.
Assuming the default is back-face culling, let the triangle vertices be (r
i
, u
i
, d
i
,
w
i
),0≤ i ≤2, which are the clip-space coordinates of the transformed