March 2013
Intermediate to advanced
984 pages
26h 18m
English
Within the OpenGL pipeline, between the vertex shading stages (vertex, tessellation, and geometry shading) and fragment shading, is the rasterizer. Its job is to determine which screen locations are covered by a particular piece of geometry (point, line, or triangle). Knowing those locations, along with the input vertex data, the rasterizer linearly interpolates the data values for each varying variable in the fragment shader and sends those values as inputs into your fragment shader. This process of linear interpolation when applied to color values has a special name in computer graphics: Gouraud shading.4 Colors are not the only values that are interpolated across a geometric primitive. We’ll see in Chapter 7, “Light and Shadow ...