Are the fragments that are generated made of up small squares as shown in the slide? If so, why? Wouldn't using triangles offer better accuracy for rendering an image?
Khryl
@captianFlint, the little square is just a representation. A fragment corresponds to a pixel in the image, and it will be rendered as the pixel after passing some tests such as depth test and alpha blending. so I guess the main reason for fragments to be little squares is that we like to represent image pixels as little squares, which is not a very precise representation ;-)
Are the fragments that are generated made of up small squares as shown in the slide? If so, why? Wouldn't using triangles offer better accuracy for rendering an image?
@captianFlint, the little square is just a representation. A fragment corresponds to a pixel in the image, and it will be rendered as the pixel after passing some tests such as depth test and alpha blending. so I guess the main reason for fragments to be little squares is that we like to represent image pixels as little squares, which is not a very precise representation ;-)
@Khryl A Pixel is not a little square
;-)
What sort of things can be primitives outside of the examples given (triangles, points, and lines)? Can any polygon be a primitive?
@jaguar, yes, GL_POLYGON can be taken as parameter for
gl_Begin()
. Also you can consider quadrilaterals as primitives as implied byGL_QUAD
.@jaguar
There are also some really exotic primitives like
GL_LINE_LOOP
andGL_TRIANGLE_FAN
. Here is a nice illustration:In practice, triangles are used most often, though some subdivision algorithms use quads.
For those that want to learn more about rasterizing primitives:
http://15462.courses.cs.cmu.edu/fall2015/lecture/triangle
http://15462.courses.cs.cmu.edu/fall2015/lecture/pipeline