Graphics Reference
In-Depth Information
floating-point value tips over 3.0, the actual value used becomes 4.0. There is no smooth
transition, and the change is binary—it's either 3 or 4, nothing else.
The pow2 partitioning is similarly straightforward, in that it rounds completely and
immediately up to the next 2" integer value. With 9 distinct tessellation factors, there are
only two distinct outputs—4 or 8—and as with integer partitioning, there is no interpola-
tion between these two outputs.
Things get much more interesting with the fractional partitioning functions. A quick
glance reveals that the size of some of the rows/columns in the grid of triangles changes
with the tessellation factor. A closer look will show that they change smoothly in line with
the floating-point factor provided by the hull shader.
As with integer partitioning, the two fractional methods will add new segments as
soon as the floating point factor crosses one of the odd or even boundaries, but unlike in the
integer mode, it will set two of these segments to be incredibly small and have them slowly
grow to the desired size of the next factor up.
Expressing this transition as a percentage makes it easier to understand. For the mid-
dle column of Figure 4.19 the "raw" tessellation factors are 3.00, 3.25, 3.50, 3.75, 4.00,
4.25, 4.50, 4.75, and 5.00. But only the first and last images in that sequence have com-
pletely finished tessellation (only 3.00 and 5.00 are odd numbers!) so the sequence could
be 3.00, 12.5%, 25%, 37.5%, 50.0%, 62.5%, 75.0%, 87.5%, and 4.00—the middle percent-
ages are now more like the weighting used in the common linear interpolation equation.
The f ractional_even, right-hand column can be expressed similarly, except that only the
4.00 value in the middle is an even number, and thus of its all segments are equally sized. The
right-hand column would become 75%, 87.5%, 4.00, 12.5%, 25%, 37.5%, 50%, and 62.5%.
An interesting observation is that for each integer increment of tessellation factor
with f ractional_odd or f ractional_even (such as 2-4 or 3-5) will add two new seg-
ments. This makes the morphing pattern much more predictable, since the GPU implemen-
tation can place one smaller segment on either side of the reflection/mirror axis. A similar
morphing effect with the integer partitioning method would be difficult for the same rea-
sons; adding only one new segment per increment means, for even numbers, that it would
have to choose one side of the axis and not be a pure reflection.
Transitioning between Levels of Detail (LODs) for integer partitioning can get tricky,
but the relatively large jumps for pow2 partitioning can be very convenient. First, the transi-
tion between segments matches the transition between texture mip-map levels (assuming
that the convention of 2" texture dimensions is being used), which may be helpful when
the domain shader uses a texture to generate the final geometry. Second, each transition
doubles the number of segments, which can also be interpreted as splitting each existing
segment into two pieces. For custom morphing algorithms this can be a very useful piece
of information, since every sample location from the lower/previous level is still present,
and all new vertices are equidistant between previous positions, making it relatively simple
to interpolate for the new values.
Search WWH ::




Custom Search