i
i
i
i
i
i
i
i
636 13. Curves and Curved Surfaces
itives, we can easily find the transformed edge vertices from the texture
from the first pass by using the vertex ID. When this is done, we compute
a fractional tessellation factor, f
i
, and write it out to a two-dimensional
texture as well. Techniques for this are described in the next subsection,
called Terminating Adaptive Tessellation. Note that since a tessellation
factor is computed based solely on the edge’s two vertices, and because
fractional tessellation is symmetric, there cannot be any cracks with this
technique. The entire system has been designed to avoid such issues. How-
ever, the developer has to take care that edges always are treated with the
same vertex order, because floating-point imprecision may create cracks if
the same order is not preserved.
In the final pass, we use the two textures from the first and second
passes as input data to the tessellation hardware, which automatically uses
on each edge the correct fractional tessellation factor, computed in the
previous pass. After tessellation, the vertex shader program evaluates the
curved surface, possibly with displacement as well, and then the triangles
are rendered. An example of the results is shown in Figure 13.57.
Terminating Adaptive Tessellation
To provide adaptive tessellation, we need to determine when to stop the
tessellation, or equivalently how to compute fractional tessellation factors.
Either you can use only the information of an edge to determine if tessel-
lation should be terminated, or use information from an entire triangle, or
a combination.
It should also be noted that with adaptive tessellation, one can get
swimming or popping artifacts from frame to frame if the tessellation fac-
tors for a certain edge change too much from one frame to the next. This
may be a factor to take into consideration when computing tessellation
factors as well.
Givenanedge,(a, b), with an associated curve, we can try to estimate
how flat the curve is between a and b. See Figure 13.60. The midpoint, m,
in parametric space between a and b, is found, and its three-dimensional
counterpart, c, is computed. Finally, the length, l, between c and its
projection, d, onto the line between a and b, is computed. This length,
Figure 13.60. The points a and b have already been generated on this surface. The
question is: Should a new point, that is c, be generated on the surface?