What Does the Geometry Shader Do?
• Triangle fans.
• Triangles with adjacency.
• Triangle strips with adjacency.
• Quad strips.
Any of these topologies can be used by
the application, but geometry shaders have
a limited number of topologies that they can
accept. These are points, lines, lines with
adjacency, triangles, or triangles with adja-
Thus, the primitives used by the appli-
cation sometimes need to be internally con-
verted. You, the application programmer, don’t need to know about this. But,
you, the shader writer, do.
On the output side, the geometry shader then generates points, line strips,
or triangle strips, and feeds them on to the rest of the graphics pipeline.
There needn’t be any correlation between geometry shader input type
and geometry shader output type. Points can generate triangles, triangles
can generate triangle strips, and so on. In the silhouee example later on in
this chapter, the input is the new “triangles with adjacency” graphics primi-
tive, while the output is simply lines. This is described more visually in Fig-
Figure 12.2. The kinds of processing geometry shaders can do.
Geometry shaders are not intended
to provide a general-purpose LOD
capability because (1) they have
a limit to the number of new
vertices that they can create, and
(2) they have limited access to the
surrounding vertex information
that would be needed for, say,
subdivision surfaces. Tesselation
shaders are meant for this and are
described in the Chapter 13.