Graphics Reference
In-Depth Information
A very important point to note is that the control points out-
put by the hull shader are not used by this stage. That is, it does all
of its tessellation work based on the two aforementioned inputs.
The control points are there for you as the developer to create your
tessellation algorithm (they reappear again as an input to the do-
main shader), and the fixed-function stage doesn't pay them any
attention. This is why there are no restrictions (other than storage)
or requirements on the output from the individual invocations.
The output from the tessellator is a set of weights corre-
Figure 4.6. Fixed func-
tion stage.
sponding to the primitive topology declared in the hull shader—line, triangle or quad. Each
of these weights (presented as the SV_DomainLocation input) is fed into a separate domain
shader invocation, which is discussed next. In addition to these newly created vertices,
which the developer actually sees as part of the domain shading stage, the tessellator also
handles the necessary winding and relations between domain samples, so that they form
correct triangles that can later be rasterized.
4.2.5 Domain Shader
Domain shader invocations run in isolation, but as is necessary,
they can see all the control points and per-patch constants out-
put earlier in the pipeline by the hull shader stage. Simply put,
the domain shader's job is to take the point on the line/triangle/
quad domain provided by the tessellator and use the control points
provided by the hull shader to create a complete new, renderable
vertex (see Figure 4.7).
It is now the domain shader's responsibility to output a clip-
space vertex coordinate to SV_Position. (Strictly speaking, the
geometry shader could do this, but it will be less efficient.)
Figure 4.7. Domain
shader stage.
4.2.6 Geometry Shader
With regard to tessellation, this stage remains
unchanged from previous versions of Direct3D
(see Chapter 3 for details on refinements af-
fecting other aspects of Direct3D rendering)
and effectively marks the end of any tessella-
tion related programming. Unless the domain
shader has passed along any of the control mesh
Figure 4.8. Geometry shader stage.
Search WWH ::




Custom Search