Graphics Reference
In-Depth Information
6.1.1 The Design of WPF 3D
There are dozens of commonly used 3D graphics platforms, covering a wide vari-
ety of design goals. Some are focused on image quality/realism regardless of cost
(e.g., systems used to compute the frames for high-quality 3D animated films),
while others target real-time interactivity with more-or-less realistic simulation
of physical properties (e.g., systems used for creating 3D virtual-reality environ-
ments or video games), and yet others make compromises on image quality in
order to achieve reasonably fast performance across a wide variety of hardware
platforms.
As described in Chapter 2, WPF is a retained-mode (RM) platform—the appli-
cation uses XAML and/or the WPF .NET API to specify and maintain a hierar-
chical scene graph stored in the platform. (You'll learn in Section 6.6.4 why it's
called a “graph”; for now, just think of it as a scene database.) The platform, in
conjunction with the GPU, automatically keeps the rendered image in sync with
the scene graph. This kind of platform is significantly different from immediate-
mode platforms such as OpenGL or Direct3D, which do not offer any editable
scene retention. For a comparison of these two different architectures in the con-
text of 3D platforms, see Chapter 16.
WPF's primary goal is to bring 3D into the domain of interactive user inter-
faces, and as such it was designed to meet these requirements:
• Support a large variety of hardware platforms
• Support dynamics for low-complexity scenes with a real-time level of per-
formance on hardware that meets basic requirements
• And provide an approximation of illumination and reflection sufficiently
efficient for real-time creation of visually acceptable 3D scenes
Here we use WPF 3D to introduce some 3D modeling and lighting techniques by
example, taking advantage of WPF's easily editable scene descriptions to give you
a hands-on understanding.
6.1.2 Approximating the Physics of the Interaction
of Light with Objects
Each object in a 3D scene reflects a certain portion of incident light, based on
the reflection characteristics of the object's material composition. Moreover, each
point on the surface of an object receives light both directly from light sources
(those that are not blocked by other objects) and indirectly by light reflected from
other objects in the scene. The complex physics-based algorithms that directly
model the intrinsically recursive nature of interobject reflection (described in
Chapters 29 through 32) require lots of processing; if real-time performance is
the goal, they often require more processing power than today's commodity hard-
ware can provide. Thus, real-time computer graphics is currently dominated by
approximation techniques that range from loosely physics-based to eye-fooling
“tricks” that are not based on physical laws in any way.
The approximation techniques that generate the highest level of realism
demand the most computation. Thus, interactive game applications (for which
animating at a high number of frames per second is essential for success) must
rely on the fast algorithms that compromise on realism. On the other hand, movie
production applications have the luxury of being able to devote hours to comput-
ing a single frame of animation.
 
 
 
Search WWH ::




Custom Search