Chapter 3: Hanging Ten - A Ride Through the Rendering Pipeline


Overview

Now it is time to start thinking in the third dimension. Everything we have done so far has been two dimensional. This chapter will give you the background information for the traditional 3D rendering pipeline. I specify traditional because there are currently two possible rendering pipelines: the traditional fixed-function pipeline and the vertex and pixel shader pipeline. The traditional pipeline involves the following steps:

  • Vertex data and high-order primitive tessellation

  • Transformation and lighting

  • Viewports and clipping

  • Texturing/ Multitexturing

  • Fog blending

  • Alpha, stencil, and depth testing

  • Frame buffer blending

DirectX 8 added vertex and pixel shaders that use an assembly language-like shader language. The vertex shaders replaced the transformation and lighting step and the pixel shaders replaced the texturing/multitexturing step in the pipeline. In DirectX 9, the assembly language-style shaders have been replaced with the High Level Shader Language that uses C language-style syntax. Several chapters could be devoted to these shaders. Rather than delve into the more advanced features of the shaders in this book, we are going to stick with the traditional pipeline. You need to have a firm grasp of this technology before proceeding to vertex and pixel shaders.

Much of the traditional pipeline is supported in hardware on modern video cards. This chapter focuses on the preparation of the mesh data and the process of feeding the data to the hardware for rendering. In fact, the majority of the chapter deals with defining exactly what vertex data will be submitted for rendering and how that data is arranged. To achieve peak performance in 3D rendering, we need to minimize rendering state changes (e.g., texture selection, lighting settings, setting of transform matrixes ) to an absolute minimum.




Introduction to 3D Game Engine Design Using DirectX 9 and C#
Introduction to 3D Game Engine Design Using DirectX 9 and C#
ISBN: 1590590813
EAN: 2147483647
Year: 2005
Pages: 98

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