A circle is a very common geometric shape that is widely used across a variety of computer graphics application, such as rendering statistics with pie graphs, drawing sign boards, animating dot patterns, and so on. In this recipe, we will implement an antialiased circle geometry with the help of texture coordinates and make it smoother using the adaptive anti-aliasing technique from the previous recipe.
One way to implement the antialiased circle geometry is to generate a set of vertices along the circumference of the circle, where every two consecutive vertices are connected to the center vertex (origin), creating a triangular slice. Several such slices are required to create the skeleton of the circle, as shown in the following image. When these vertices are rendered with the triangle primitive, they produce a filled circle pattern. The smoothness of the produced circle shape is highly dependent on the number of vertices used along the circumference...