PDA

View Full Version : what is a fragment in OpenGL?



cem polat
10-13-2004, 01:23 AM
In OpenGL Reference Manual for the glAlphaFunc section, it was written that
"The alpha test discards fragments depending on the outcome of a comparison between an incoming fragment's alpha value and a constant reference value. glAlphaFunc specifies the reference value and the comparison function. The comparison is performed only if alpha testing is enabled. By default, it is not enabled. (See glEnable and glDisable of GL_ALPHA_TEST.) "

What is fragment in this description? Can we use the term "pixel" instead of "fragment"? Why do we need use another term other than pixel? That is because fragment does not cover the term pixel 100%? Is fragment refers to a single pixel or a group of pixels?

In OpenGL Spec fragment is defined as
"A grid square along with its parameters of assigned colors, z (depth), fog coordinate,
and texture coordinates is called a fragment;"

But this description does not tell the relation with pixels. I need a clear relation between fragment and pixel.

dvm
10-13-2004, 02:29 AM
I think a pixel is just a position on the screen along with is color.

Relic
10-13-2004, 03:30 AM
The final data you see on the screen are pixels, the OpenGL rasterizer pipeline sometimes works on a finer grid, that is why the fragment term is used as long as you're running through the pipeline.
Most of the times one fragment specifies one pixel in the end.
With multisampling (or FSAA) for example, you have multiple fragments which, combined, generate the final pixel on screen.