Graphics Reference
In-Depth Information
Triangle fans.
Triangles with adjacency.
Triangle strips with adjacency.
Quads.
Quad strips.
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.
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-
cency.
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 silhouete 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-
ure 12.2.
Figure 12.2. The kinds of processing geometry shaders can do.
Search WWH ::




Custom Search