Graphics Reference
In-Depth Information
the current algorithm, as if it were the original geometry passed into the pipeline in the in-
put assembler stage. Different tessellation algorithms could be swapped in and out without
affecting the rest of the pipeline, as long as it is capable of consuming the available input
control patch geometry.
Tessellation algorithm level of detail. This ability to swap tessellation algorithms could
also be used as a form of level-of-detail, where a more complicated or more aggressive
tessellation scheme can be chosen for objects close to the camera, while a less complex
one can be used for objects farther away. This would be considered a coarser form of LOD
than the process of actually varying the amount of tessellation (which is performed with
the patch constant function).
Generic control point calculations. The hull shader program can also be used for a va-
riety of other processing tasks not related to tessellation. Since it is the last stage before
tessellation actually occurs, it is a good candidate for performing calculations that will be
shared by more than one of the tessellated points. This can effectively pull the calculations
back to an area of the pipeline before the data amplification of the tessellation procedure,
saving significant processing costs.
Tessellation Factor Calculations
The idea behind the patch constant function is that it will calculate two tessellation factors,
which are written to special system value semantics. These two system values semantics
tell the fixed function tessellator stage how finely to tessellate the primitive being generated
from the input control patch. The number of tessellation factors required is influenced by
the domain function attribute mentioned above. The type of primitive that is conceptually
being split up by the tessellator stage is specified in this attribute. Depending on which type
of domain is specified (isoline, triangle, or quad) the number of required edge tessellation
factors will vary.
The patch constant function itself is declared with another attribute—patch-
constantfunc. This simply identifies which HLSL function should be executed for the
patch constant function. The remaining function attributes listed above are used to config-
ure execution of the tessellation stage. The partitioning attribute configures the type of
tessellation to perform, the outputtopology attribute defines the type of output primitives
that will be created by the tessellation, and the optional maxtessf actor attribute tells the
driver the maximum amount of tessellation it should expect, so that it can allocate an ap-
propriate amount of memory to hold the results.
These attributes and their available values will be discussed in detail in Chapter 4,
"The Tessellation Pipeline." However, the important concept to take away from these con-
figurations is that the patch constant function and the function attributes specified with
it are used to determine precisely what the tessellator stage produces. In many ways this
Search WWH ::




Custom Search