Graphics Reference
In-Depth Information
like face color have to be implemented by a similar vertex-duplicating strategy in
which all three vertices of a face are assigned the same color, requiring multiple
co-located vertices and nonwatertightness of the meshes.
As you think about applying any particular algorithm to your own meshes,
be sure that your assumptions about the mesh and those made by the algorithm
designer actually match, or expect bad results.
25.4 Level of Detail
A model of an office building might contain millions of polygons, both for interior
detail and for things like windows, frames, exterior trim, etc. If that building is to
appear in the far distance in some scene, it may suffice to remodel it as a single
rectangular box. Indeed, if you do not remodel it that way, then rendering just
a few city blocks will rapidly consume your entire budget for polygons, while
perhaps only determining the final appearance of a small fraction of the pixels
in your image. This is a clear misallocation of resources. If you're using basic
z -buffering to determine visibility, and your building occupies, say, 100 pixels of
the image, then (since each pixel's color is determined by the frontmost polygon
drawn in it) all but 100 of your 1 million polygons will have been drawn to no
avail.
It's possible to improve this situation substantially with visibility hierarchies
so that, for instance, none of the polygons interior to your building get drawn. But
for a building with substantial exterior detail, this is merely a palliative measure.
What's really needed is a different model of the building, used when the model is
in the distance. If you make an animation, the high-detail model is used when the
building is nearby and the low-detail model is swapped into its place as the build-
ing recedes into the distance. Naturally, it's important that the swapping process
be relatively undetectable, or the illusion of the animation will be broken. The
substitution of a simpler model for the completely detailed model can be done
in stages; in other words, it makes sense to build a model that includes multiple
levels of detail, each one used where appropriate.
The inclusion of levels of detail represents a substantial architectural shift.
Normally we imagine a renderer asking each object for a polygonal representation
of itself, and then producing an image from these polygons. In a system using
level of detail, the renderer must ask the object for a polygonal representation
and provide some information about the level of detail. This information might
be something like the distance from the camera to the object's center, or a request
for the object to provide a representation with no more than 10,000 polygons, or
a request to provide one of three or four standard levels of detail.
Inline Exercise 25.7: I can render a building from nearby with a wide-angle
lens; the building fills most of the image. I can render it from very far away
with a narrow-angle lens, and again it fills most of the image. What does this
suggest to you about using the distance to the object as a level-of-detail cue?
What might improve it?
A useful approach for determining level of detail is to have a coarse repre-
sentation of the model, such as a bounding box; the rendering software can then
quickly determine the screen area of the bounding box, and it can use this to help
 
 
 
Search WWH ::




Custom Search