Chapter 5 -- Direct3D Vertices and the Transformation and Lighting Pipeline

[Previous] [Next]

Chapter 5

The task of rendering a 3D object is divided into two stages. The first stage is called transformation and lighting (and is often abbreviated as "T&L"). In this stage, each vertex of the object is transformed from an abstract, floating-point coordinate space into pixel-based screen space, taking into account the properties of the virtual camera used to render the scene. In addition, the effect of various types of lights can be applied to the vertices. (A few other important tasks, such as clipping and viewport scaling, take place in the first stage too.) In the second stage, called rasterization, primitives are used to organize these transformed and lit vertices into points, lines, and triangles. The rasterizer draws the resulting shapes into the DirectDraw surface known as the render target while applying texture maps and interpolating various properties such as color between connected vertices. Rasterization is also where the depth buffer is used to determine which of the resulting pixels will be visible to the user and which are obscured by the pixels of other primitives. Figure 5-1 shows how these stages work together to implement the task of rendering a 3D object.

click to view at full size.

Figure 5-1 The two stages of rendering a 3D object

Direct3D can perform both the T&L stage and the rasterization stage. You can configure Direct3D to perform the steps separately or together in a single function call, depending on the needs of your program. If you want, you can provide your own transformation and lighting, and pass processed vertices directly to the Direct3D rasterizer, bypassing Direct3D's T&L stage. This chapter discusses Direct3D vertices and the process of transforming and lighting them. Chapter 6 will talk about rasterizing primitives onto the render target, using the transformed and lit vertices.



Inside Direct3D
Inside Direct3D (Dv-Mps Inside)
ISBN: 0735606137
EAN: 2147483647
Year: 1999
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net