-The output of the rasterization and interpolation stage are the pixel positions (x,y), together with their color (and optionally other variables that can be defined in the shader, we will cover this a few paragraphs later). This information (position, color, and other per-pixel variables) is called a fragment. The fragments are processed in the next stage, called the fragment shader. In this particular example, the fragment shader doesn't do much, it only writes the color to the screen position (x, y). At this point it is useful to think, in the same way we think of the vertex shader as operating on each input vertex at the time, of the fragment shader as operating on each fragment coming down the pipeline at the time, and then outputting the color of the fragment to the screen. As a way to see this more clearly, we could imagine the vertex shader as a "function" that is called inside the loop that runs over all the input vertices. We could write in pseudo-code:
0 commit comments