Chapter 11. Introducing the Programmable Pipeline with the High Level Shader Language

IN THIS CHAPTER

  • Rendering a Single Triangle Without Using the Fixed-function Pipeline

  • Rendering Shader Programs with Techniques

  • Rendering Meshes Using the Programmable Pipeline

  • Using HLSL to Write a Pixel Shader

  • In Brief

Up to this point, you've been using the fixed-function pipeline to do all of your rendering. Back in the "old days" (before the release of DirectX 8.0) this was the only way to render anything. The fixed-function pipeline is essentially a set of rules and behaviors that govern how particular types of data will be rendered. While sufficient for many things, it lacks the control some developers need to fully take advantage of the features they plan on using. For example, all lighting in the fixed-function pipeline is done per vertex, rather than per pixel. With the rendering pipeline "fixed," there was no way to change the behavior of many rendering options, such as lights.

Enter DirectX 8.0 and the programmable pipeline. A revolutionary feature that first shipped with this release allowed the developers to control most every aspect of the pipeline. They could control the vertex processing with a new feature called "Vertex Shaders," and they could control the pixel processing with the aptly named "Pixel Shaders." These shader programs were quite powerful, but they were also not very easy to use. The syntax of the language resembled assembly, and it became apparent that something easier was needed.

In DirectX 9 the High Level Shader Language (HLSL) was released. HLSL was a simple C-like language that could be compiled into real shader code, but was much easier for the developers to read, maintain, and author. The full power of the programmable pipeline was still available in a much easier to use package. In this chapter the basic features of the High Level Shading Language will be covered, including

  • Using the programmable pipeline.

  • Transforming vertices.

  • Using pixel shaders.



Managed DirectX 9 Graphics and Game Programming, Kick Start
Managed DirectX 9 Kick Start: Graphics and Game Programming
ISBN: B003D7JUW6
EAN: N/A
Year: 2002
Pages: 180
Authors: Tom Miller

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