Graphics Reference
In-Depth Information
The Relation of Vertex Shaders to Tessellation Shaders
Tessellation shaders can optionally follow vertex shaders in the shader pipe-
line Their primary function is to expand an original geometric primitive into a
set of primitives that expresses the geometry in more detail. This can be done
by, for example, performing adaptive subdivision, refining coarse models into
finer ones, applying displacement maps, and carrying out level-of-detail adap-
tations to improve the visual quality of an image.
The input to the tessellation shaders consists of the assembled primi-
tives from a vertex shader together with data that controls the subdivision to
be performed. The output from the tessellation shaders consists of the collec-
tion of vertices for the new geometry, ready for the next primitive assembly
step. This is all discussed more fully in Chapter 13.
The Relation of Vertex Shaders to Geometry Shaders
Geometry shaders have many of the same capabilities as tessellation shaders,
but with two very important differences:
1. Besides some standard primitives, they may take as input a different
kind of graphics primitive, which includes not only vertices in the primi-
tive but also vertices adjacent to the primitive—the “geometry with adja-
cency” primitive type—and they produce standard graphics primitives
as output.
2. In creating the output, they are allowed to create new topologies. For
example, a geometry shader can take points in and produce triangles out,
or can take triangles in and produce lines out.
In either case, both tessellation and geometry shaders can rely on vertex
shaders to preprocess vertices and manage atribute variables for the beneit of
the rest of the pipeline This is all discussed more fully in later chapters.
Replacing Fixed-Function Graphics
with Vertex Shaders
On general principle, it should be possible to write a vertex shader to carry
out any of the non-reserved vertex processing functions of the fixed-function
Search WWH ::




Custom Search