06: Interpolate attributes

We are now able to draw lines and triangles and customize how they look and where they appear on the screen with our new shaders.

So far we are kinda limited though, as we only have a mechanism for passing data to both shaders at once. The fragment shader doesn't really get any information aside from the fragment coordinate and the uniform data.

But what if we wanted to dynamically compute the output color based on where we are on the line or triangle? One of the simplest examples is specifying the color at the endpoints and then gradually coloring in the in-between values with a mix of the endpoints.

The generic mechanism to achieve these kinds of things will be implemented in this section. We will start with lines and then move on to triangles, although for those we will see, that we already implemented most of it!

The main part of the work will be adding some additional data objects along the way, but nothing too complicated.

You can find the full rasterization code here: Rasterizer 06