left-icon

Direct2D Succinctly®
by Chris Rose

Previous
Chapter

of
A
A
A

CHAPTER 15

Rendering Pipeline

Rendering Pipeline


The rendering pipeline, sometimes called graphics pipeline, or simply pipeline, is the set of steps to transform vertices and other structures from a collection of floating point values into 3-D graphics. In order to create graphics, the programmer uses code and data to create a collection of points, triangles, vertices, and so on. They must be transformed and manipulated by the hardware such that a 3-D scene can be displayed on the user’s 2-D screen.

Each API and each generation of each API has its own rendering pipeline. The Direct3D rendering Pipeline (although related in some ways) is different from the OpenGL one. The Direct3D 9 pipeline is very different from the Direct3D 11 pipeline. Things have gradually become more flexible as the power of the hardware has scaled. The present pipeline has several stages that are programmable. This means the programmer is able to code instructions for the graphics card directly. Other steps in the pipeline are automated, or at least semiautomated. The programmer can select some settings but cannot dictate what the GPU is to do directly. Each stage of the pipeline takes input from the previous stage and gives input to the next stage. Several of the stages are optional. These are the steps to the current (DirectX 11) rendering pipeline:

  1. Input Assembler
  2. Vertex Shader
  3. Hull Shader
  4. Tessellator
  5. Domain Shader
  6. Geometry Shader
  7. Rasterizer
  8. Pixel Shader
  9. Output Merger

Input Assembler

This stage of the pipeline is where we set up the resources, vertices, colors, and so on—anything we need the GPU to render.

Vertex Shader

This stage is completely programmable. A vertex shader is a small chunk of code that is to be run for every vertex from the previous stage.

Hull Shader, Tesselator, Domain Shader

The next three shaders are new to DirectX 11, and they are for tessellation. Tessellation can increase and decrease the level of detail in a polygon to scale with the hardware running the application. This book will not cover the topic of tessellation.

Geometry Shader

The geometry shader was new to DirectX 10. It is a programmable shader that works on whole shapes, whereas the vertex shader just worked on a single vertex. It is optional and we will not cover geometry shaders in this book.

Rasterizer

The rasterizer takes the vertices from the previous stage and determines which pixels are visible. This is very important because if a pixel is not visible, there is no point in computing its eventual color. The rasterizer clips the scene and performs backface culling. Backface culling is the removal of polygons that are facing away from the camera and are therefore not visible.

Pixel Shader

The pixel shader is another programmable stage in the pipeline. Pixel shaders are executed once for every visible pixel in the scene. There can be significantly more than a million pixels visible in a scene, so it is important to keep pixel shaders very efficient.

Output Merger

This stage puts all the information together and displays the image.

Note: Since this is only a very short introduction to Direct3D, the only shaders we will be using are the vertex shader and the pixel shader. In the follow-up book, Direct3D Succinctly, we will examine the API in greater detail.

Scroll To Top
Disclaimer
DISCLAIMER: Web reader is currently in beta. Please report any issues through our support system. PDF and Kindle format files are also available for download.

Previous

Next



You are one step away from downloading ebooks from the Succinctly® series premier collection!
A confirmation has been sent to your email address. Please check and confirm your email subscription to complete the download.