Graphics Reference
In-Depth Information
ID3DllDeviceContext::DSSetShaderResources()
ID3DllDeviceContext::DSSetSamplers()
3.7.3 Domain Shader Stage Processing
The primary job of the domain shader stage is to create vertices using the generated set of
coordinate points from the tessellator stage, by using the control patch and patch constants
produced by the hull shader stage. The most important task for creating these vertices is
determining their position, since this will directly affect how the final tessellated geometry
will be rasterized. With this in mind, we will take a closer look at how the position is calcu-
lated in the domain shader program and will provide some high-level concepts for thinking
about this process.
The data held in the points within the control patch can represent a wide variety
of different types of higher-order surfaces. The control points can be used to implement
Bezier curved surfaces (Akenine-Moeller, 2002) just as easily as they can represent normal
vertices, as used in curved point triangles (Vlachos, 2001). 1 6 The only requirements are
that the hull shader program must produce the expected format of data, and that the domain
shader must implement a compatible algorithm for generating an output position for each
coordinate point.
In a more generalized view, we can think of the control patch as a set of parameters
which define a virtual surface. This surface must be valid over the entire domain of the
control patch, since this is the region in which all of the input coordinate points will reside.
Then we can think of each of the coordinate points produced by the tessellator stage as a
selected location where we want to sample the virtual surface. This can be visualized with
a simplified case, as shown in Figure 3.29,
where we see an isoline domain, its control
points, and the virtual surface that it repre-
sents. The selected sampling points along the
isoline domain indicate the locations that are
sampled along the virtual surface.
The important message to take from
this concept is that the virtual surface remains
the same regardless of where the tessellator-
generated points are located or how many
there are. This can help us break the overall
Figure 3.29. A depiction of how a control patch
defines the parameters of a virtual surface, and
the tessellator-generated points that can be con-
sidered as sampling locations for this surface.
1 6
Bezier curved surfaces are discussed in more detail in Chapter 4, while curved point triangles are discussed
further in Chapter 9.
Search WWH ::




Custom Search