Graphics Reference
In-Depth Information
Exercises
1. In the uniform variables in the .glib file for the Bézier curve, you will
note that the variables uOuter0 and uOuter1 are slider uniform variables
and can be set to a range of values. Experiment with these variables and
note the result. Change the limits on the range of each and repeat the
experiment.
2. Deliberately break the rules of good sense on tessellation levels to see the
results. First, create two patches that share an edge and tessellate each
with different outer tessellation levels to create holes between the two
tessellated patches. Second, use wildly different inner and outer tessella-
tion levels on a rectangular patch to see what the result looks like and to
get a sense of how much difference between these might be reasonable.
3. Complete the Bézier surface example by supplying vertex, geometry,
and fragment shaders for it. Experiment with the tessellation levels;
start by giving different values to the two outer or two inner levels and
note the result. Then add more uniform slider variables so that each of
the four outer or inner levels is set separately, and note the result. It is
quite possible to get really strange (and essentially unusable) results for
some values of these levels; don't worry about that. It is useful to use the
shrink geometry shader with this exercise so you can see the triangles
more easily.
4. For a triangle tessellation, use a variety of values for the outer and inner
tessellation levels. In particular, try out different values for the three
outer levels and observe the results. It is useful to use the shrink geom-
etry shader with this exercise so you can see the triangles more easily.
5. We have seen both sphere octant and whole-sphere examples in this
chapter, but we have not compared their operation. Create a whole
sphere from eight sphere octants and compare the quality of the result-
ing sphere with the whole-sphere quality. Can you say anything about
the speed of drawing spheres these two ways?
6. Take one of your models based on triangles with vertex normals, or cre-
ate a model of this sort, and apply the set of shaders given here for VN
triangles. Examine the result carefully to see how it improves, or fails to
improve, the concept you had in mind when you developed the model.
7. One of the historic uses of tessellation is to create a patern of regu-
lar polygons or figures that fills a plane without any gaps or overlap-
ping, like you see in the works of M.C. Escher. An example is shown in
Figure 13.25.
Search WWH ::




Custom Search