Graphics Reference
In-Depth Information
7
Vertex Shaders
In fixed-function OpenGL, the vertex processing in the graphics pipeline is
responsible for taking the model-space geometry you define, along with what-
ever color, lighting, materials, shading, and texture information you specify,
and creating a set of vertices in clip space that have color, depth, normal,
and texture associated with each. The role of the vertex shader is shown in
Figure 7.1. The vertex shader replaces much of the fixed-function vertex pro-
cessing, and possibly changes the vertex coordinates as well. It also sets up
the shader environment for any further vertex processing by tessellation and
geometry shaders and for the rasterization and fragment shader processing.
In this chapter, we will discuss the vertex shader from a functional
approach: what it does, what its inputs are, what its outputs are, and what
kind of operations it can perform. We will also see several examples of vertex
shaders that carry out many of these shaders' different operations.
139
 
 
Search WWH ::




Custom Search