Graphics Reference
In-Depth Information
Figure 3.54. A depiction of the minimum and maximum depths of an object, enabled by using varying
culling modes.
channel, and the nearest point in the green channel. Together, the difference between these
two values provides an estimate of the thickness of an object. 3 0
This concept is depicted in
Figure 3.54. In algorithms such as this, it is necessary and useful to cull triangles with one
orientation in one pass, and then cull the opposite orientation in the second pass. A number
of special effects can be achieved by manipulating the culling order.
Primitive culling. The second form of culling that is performed in the rasterizer stage
tests if there are any primitives that reside completely outside of the unit cube in normal-
ized device coordinates. This can be conservatively determined by testing if all of the
vertices of a primitive are outside of the same clipping plane, where the clipping planes
are defined by the faces of the unit cube. This operation can be performed very efficiently
when performed in clip space, 3 1
since the planes are axis-aligned and are always located
at the same distance from the origin. For example, to test if the three vertices of a triangle
are all outside of the top plane of the unit cube, the test simply consists of checking if the
F-component of their clip space positions is greater than its W -component. The test can be
performed by taking the difference of the W -component minus the Y -component. If all of
the results are negative, the primitive can be safely discarded from further processing. This
5 0
There are other, newer techniques that can perform this depth calculation in a single pass, but the example is
still a valid situation where multiple rendering passes are required with switched culling order.
; Which space this is performed in is up to the hardware implementation, and may or may not be performed in
clip space.
Search WWH ::




Custom Search