Graphics Reference
In-Depth Information
and external) in a tighter range will greatly improve the final results and avoid the case
where factors at opposite extremes come into contact with each other. This will provide a
more uniform sampling of the primitive, which in general produces a higher-quality output
image.
4.4.3 Partitioning
A detail that has been omitted up to this point is the partitioning method, which is declared
as an attribute on the main hull shader entry point. This can be integer, fractional_even,
fractional_odd, or pow2 and will affect how the fixed-function tessellatOr interprets the
tessellation factors provided by the hull shader constant function.
Because this value is declared as a compile-time constant, it will be the same for
all patches being rendered with this particular hull shader. This removes any potential
hassle with trying to match patch edge factors between different partitioning functions—
two quads sharing an edge where each quad defines a different edge factor is tricky enough
without the two quads using different internal algorithms.
A key observation is that the factors are specified as float values by the constant func-
tion, yet it makes no real sense to have a fractional quantity as you either generate a new
piece of geometry or don't—you can't create half of a triangle!
Some important considerations include:
Integer partitioning rounds all floating-point values up to their nearest integer in the
range 1 to 64.
Using f ractional_even rounds to the nearest even number in the range 2 to 64 ba-
sically, the series 2, 4, 6, 8, 10 ... .
Using f ractional_odd rounds to the nearest odd number in the range 1 to 63—basi-
cally, the series 1, 3, 5, 7, 9, 11 ...
Using pow2 rounds according to the 2n series, where n is an integer between 0 and 7.
Basically, the possible post-rounding values are 1, 2, 4, 8, 16, 32, and 64.
Figure 4.19 shows the four partitioning methods available—integer (left),
fractional_odd (middle-left), fractional_even (middle-right) and pow2 (right).
The vertical axis represents the floating-point tessellation factor provided by the hull
shader constant function—the same factor for all six tessellation factors expected for a
quad (four edge factors and two internal).
The integer partitioning scheme is straightforward, and the output is as expected—
a straight rounding up to the nearest integer. Although there are 9 distinct factors shown
(one per row), there are only 3 distinct outputs due to rounding—3, 4, or 5. As soon as the
Search WWH ::




Custom Search