the concept of AA multisampling
Posted 06 August 2005 - 05:56 AM
Supersampling basically renders the image at a greater resolution, then shrinks the image down to the selected resolution.
From what I've read, multisampling doesn't appear to work like that.
Basically, from what I've been able to determine, a single AA sample is the average color of a 1-pixel block consisting of 4 sub-pixels (a 2-by-2 block). The act of downfiltering determines the average and returns the actual color that will be applied to the 1-pixel block.
Now, take a look at nVidia's multisampling here: http://www.hothardware.com/image_popup.cfm...ticleid=707&t=a
4x AA is the building block for all the other AA modes, which is actually composed of 4 individual AA samples.
Mathematically speaking, this doesn’t make much sense to have 4 1-pixel blocks crammed into a single pixel. Something doesn't jive here. :huh:
What pieces of information am I missing, and/or what have I interpreted incorrectly? I'm throughly confused.
Also, what exactly is a "texture sample"?
Posted 06 August 2005 - 06:25 AM
Also, multisampling is very careful to specify that there are multiple samples per pixel, but their relative locations are not queriable by the application. Thus, hardware vendors are free to implement multisampling using whichever supersampling pattern seems best to them. For instance, 2X multisampling could use a sample in the center of each pixel and a sample in one of its corners, resulting in a staggered grid pattern, while 4X multisampling can use the rotated grid pattern shown in that diagram.
Posted 06 August 2005 - 06:48 AM
Ok, but that didn't really fully answer my question, though. What is the definintion of a single sample for multisampling?
I'm trying to figure out what the building blocks of this technique are.
Now, the link I provided doesn't make much sense to me because it is a 4-by-4 block, rather than a 2-by-2 block. From what I read, there are 4 subpixels to a single pixel (a 2-by-2 block), and this image shows that there are 16...and I am confused. :huh:
Also...I thought pixels could only contain a single solid color. With these subpixels, is there oversampling going on?
Posted 07 August 2005 - 03:58 AM
So it is basically like supersampling, but there is a caveat: the pixel shader is only executed once for each pixel, not for each sample. So you have the same output color being assigned to all the samples in the pixel that are covered up by the triangle being drawn. E.g. if you draw a triangle that only covers 2 of 4 samples, then those 2 sample colors are set to the color output from the pixel shader, and the other 2 are unchanged. The 2 samples also get the same stencil value. The only thing that is different between them is the depth value.
The diagram you posted shows multisampling with 4 samples in a pixel. The 4x4 grid is irrelevant, it is only drawn to show the locations of the 4 samples within the pixel (as mentioned earlier, they are in a rotated grid pattern). There are only 4 samples, not 16.
Posted 07 August 2005 - 05:32 AM
now, are these subpixels actually pieces of a pixel, or are they actually pixels at the higher resolution before reduction?
Posted 08 August 2005 - 05:31 AM
Force Flow said:
Just a note, but rendering IS sampling. You're taking a continuous function (the color of the image in screen space) and picking discrete points (samples) out of it. Normally you pick one sample in the center of each pixel. Supersampling would increase the number of pixels and then average adjacent pixels to go back down to the original size. Multisampling is not supersampling: in multisampling, you put multiple samples in each pixel, but it is not the same thing as rendering at a higher resolution. The samples can be arbitrarily located within the pixel and indeed, their locations can differ between one pixel and another.
Force Flow said:
There's no difference.
However, samples are just points, they do not represent an area.
Posted 08 August 2005 - 01:14 PM
Posted 08 August 2005 - 06:22 PM
However, our screens can only display one color per pixel, so we want to pick a color that averages out all the colors that should be in the pixel. But how do we know what color to use? Ordinary (non-multisample) rendering picks the color at the center point of the pixel. But that is just one point - it would be either gray or blue, depending on which triangle covered that point. This single sampling leads to jaggies where one pixel is gray and the one next to it is blue. Multisampling tries to get a better estimate for the color that the pixel should be, by placing several samples within it. Each of those samples is just one point, but because they are distributed over the area of the pixel, some of them will be gray and some will be blue. Then the colors of the samples can be averaged to arrive at one single gray-blue color to be displayed for the whole pixel.
So to sum up, pixels are areas, while samples are points. We want to find the average color of the whole pixel, but we are only able to find the color at discrete points. Multisampling allows us to find colors of several points within the pixel, and then average them to estimate the color of the whole pixel.
Posted 09 August 2005 - 11:28 PM
Now the theory behind sampling doesn't look complicated at all :)
One more question, though. What is the purpose of a texture sample?
Posted 10 August 2005 - 01:53 AM
Posted 10 August 2005 - 04:03 AM
Especially when comparing nVidia's 4xAA to 8xS AA
Thanks for all your help! I really appreciate it! :)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users