Graphics Reference
In-Depth Information
designer would like to have displayed on screen;
the black arrows are the line segments generated
by the Direct3D 11 pipeline to try to approximate
this surface.
The top example generates only 3 line seg-
ments. It is quite clear that the end result is not a
great approximation. The middle example uses 12
segments and does a much better job of repre-
senting the ideal surface; in particular, it only re-
ally misses detail in the tight second turn of the
surface. The bottom example uses 42 segments
and is a near-perfect enough representation of the
ideal surface.
Depending on requirements, the above ex-
ample would ideally use somewhere between 10
and 40 lines to represent the surface. Less than
10, and the approximation would simply not be
close enough; above 40 and there will be dimin-
ishing returns—extra processing work for little or no visible improvement.
A clever software algorithm would scale between 10 and 40, according to some
heuristic of the contribution to the final image. When this particular curve is dominant
(as in the center foreground) it could use the full 40 segments, whereas the opposite case
(in the far distance off to one side of the image) it would use only 10. An equally clever
algorithm may use a performance-based heuristic—if overall performance drops below a
certain threshold, it will reduce the quality of the tessellation until performance increases
again.
Figure 4.12. Approximations of a smooth
curve.
4.3.2 Defining the Tessellation Parameters
The fixed-function tessellation stage uses values from the hull shader's constant function to
decide the level of tessellation for a primitive. The following is a simple example of such
a function:
struct HS_PER_PATCH_OUTPUT
{
float edgeTesselation[3] : SV_TessFactor;
float insideTesselation[1] : SV_InsideTessFactor;
};
HS_PER_PATCH_OUTPUT hsPerPatch
Search WWH ::




Custom Search