Graphics Reference
In-Depth Information
• 64 hull shader constant function invocations
• 256 hull shader control point function invocations
• 3,596 domain shader invocations
• 2,872 triangles generated
Regarding the storage requirements, it is worth noting that a CPU implementation
of the same geometry pattern could require as much as 70 KB just for the vertex data, and
this would vary according to the LODs used for any given frame. For less than one third of
this storage, the inputs remain totally fixed and constant, and the underlying runtime and
drivers have to handle the varying output sizes internally.
9.1 .2 Extending the Interlocking Tiles implementation
It was noted in the previous section that the LOD calculation in Listing 9.7 was very naive.
This aspect proves very useful for exploring one of the best enhancements that can be made
to this implementation: the LOD equation.
Better results can be achieved on both the quality and performance axes. With a
given performance budget (for example, being able to render 1 million triangles per
second), for the sake of quality it is preferable to focus tessellation on areas where it is
most noticeable—why waste triangles on pieces of terrain that won't benefit from them?
An alternative view on the performance axis is that for a given terrain surface, there is
no point in over-tessellating and creating more work than necessary; if 650 triangles can
represent a given area, why generate 1000?
Figure 9.11 takes the inside tessellation factor for a patch and converts it into a shade
of red (high detail), green (mid detail) and blue (low detail). It is immediately obvious that
there is little red in the image, just the corners of three patches that are visible along the bot-
tom edge. It is also noticeable that a large part of the final image is comprised of tiles that
are shaded blue; in particular, many of the tiles shaded in blue are the main geographical
features of the terrain being represented!
For reference, Figure 9.10 shows the heightmap that was used to generate Figure 9.11;
areas of significant change (from dark to light or vice-versa) do not correlate directly with
the shading in Figure 9.11. This is a good indication that the algorithm is currently naive
in its distribution of detail.
The above image clearly demonstrates that a naive LOD algorithm like the one origi-
nally presented will neither generate high quality, nor high-performance results. The areas
of the image that need the most detail are being given the least, and the areas with the most
detail are being clipped by the rasterizer and not even shown.
Search WWH ::




Custom Search