what does alpha to coverage have to do with HW AA

nirradi

Newcomer
hi all

I read in a couple of places how alpha to coverage is being done and how it masks the coverage with a new value - even a random one - to create a new coverage that in turn is averaged and ultimately drawn on screen

my question is - where did the original coverage come from? is this coverage calculated in the rasterizer depending on subpixel insideness (IYKWIM?) or am i confusing different types of AA?

do GPU support this "coverage"? is this solely a SW hack? i don't get it, can anyone help?

thank you.
 
Coverage mask is calculated from the pixel shader output alpha value. For example when using 4xMSAA and writing a pixel with alpha value from 0% to 25% one sample is written to and three discarded. Alpha values 25% to 50% cause two samples to be written and two discarded. 50%-75% three samples written, one discarded and 75%-100% all four samples written. This is a GPU feature, and cannot be SW emulated.
 
my question is - where did the original coverage come from? is this coverage calculated in the rasterizer depending on subpixel insideness (IYKWIM?) or am i confusing different types of AA?
Yes, the original coverage is a bitmask with each bit indicating whether a specific sample position within the fragment is inside or outside the current triangle. It is used as a write mask when the ROPs write the fragment colour to the framebuffer.

In case of alpha to coverage, the GPU generates a coverage mask which has a number of bits proportional to the alpha value of the fragment set to 1. GPUs generally also apply some dithering in order to simulate a higher number of discrete steps than there are samples. This mask is then ANDed with the original coverage to yield the ROP write mask.
 
Back
Top