0

From reading online I understand the basic idea of how Supersampling Anti-Aliasing works, it renders the scene at a higher resolution that the user's display, uses the extra pixels to calculate an average and then downsample it.

I don't quite understand how this works in practice though. For example if there is a red pixel of a wall next to a blue pixel of a sky, when the scene is rendered x2 SSAA, won't the one red pixel now just be four red pixels and same with the blue sky pixel, how does this help when calculating an average.

Are the four new red pixels overlaid with the original image, that way you would get a mixture of red and blue pixels and be able to calculate an average to help smooth the transition between the wall and sky?

Any help would be appreciated.

1
  • Ofcourse, if you just scale up and down the result would be the same, but afaik a higher texture is loaded, ie.: the red pixel actually, in high-res are 4 different colors of red and thus a different result will be achieved.
    – ljrk
    Jul 17 '15 at 18:40
2

It helps a lot. In your original example:

... Red Red Red Blue Blue Blue ...

The boundary between red and blue looks like a stair case

In the oversampled image

... Red Red Red Red Blue Blue Blue ...

As we downsample

... Red] [Red Red] [Red Blue] [Blue Blue] [Blue ...

Now we have one pixel that is red and blue averaged together, blurring the boundary between the red and blue regions.

If you imagine a diagonal boundary between two regions, red and blue, the oversampling will insert intermediate pixels at the stair step edges as many of the 2x2 boxes necessarily include both red and blue pixels in them.

enter image description here

6
  • Hi @David, thanks for the answer. I must be an idiot 'cos I'm still not quite understanding this. When the pixel is upscaled to four times it size (with 2x SMAA), are the 3 other pixels in the new 2x2 sqaure all the same colour as the original pixel?
    – RJSmith92
    Jul 17 '15 at 19:38
  • @RJSmith92 The pixel isn't upscaled. Only downscaling occurs. Consider a diagonal line, overlay 2x2 boxes, it must be the case that some boxes contain pixels on both sides of the line. Jul 17 '15 at 19:42
  • Thanks @David, that makes more sense. When looking online all the explanations say that the image is rendered at a higher resolution, I'm not quite sure how this ties in with the process you described?
    – RJSmith92
    Jul 17 '15 at 19:51
  • 1
    Right. The image is rendered at a higher resolution and then downscaled. There's no upscaling. Jul 17 '15 at 19:55
  • OK, so a pixel will be represented by four pixels when the image is rendered at a higher resolution (using x2). The average colour of those four pixels calculated and then used for the one pixel when downscaled?
    – RJSmith92
    Jul 17 '15 at 20:09
2

Ok well I will try and explain it, because I have applied methods like this before when working with photos , to apply some of the "smoothing" algorithms to photos or low res photos, without getting a very wide deep smoothing.

it goes something like this.

Here are your pixels in the usual resolution you would be viewing in. In dire need of anti-aliasing or smoothing the jaggies.
aliased

On one side here we have up-scaled the image to 4X then applied the same anti-aliasing algorithm high and low

It is important to note that as a stupid computer , I cannot just bend the black to the white (changing the amount of whiteness), but also have to bend the white to the black (balancing the equation :-) . I am applying a mathematic matrix blindly to where I was told to apply it. Although the video card algorithms are very sophisticated and they actually are not as blind as this.

Observable example of the balance in games, You wouldn't want your fence to disappear into the sky, and you don't want your sky to become the fence, so any adjustments have to apply to both sky pixels and fence pixels more equally. Also an example of ways that the video cards and game engines upset this balance to get a best picture going still with that sort of tough details.

At some point this all has to go back to the display resolution, where it will be the lower resolution, and after having a wide array of items to adjust around, that extra bunch of pixels will now be perfectly blended into less pixels.
(well it wasn't the perfect color for that blend, but I didn't do the math) Back to low res And as you can see it looks terrible again in the display res.

On the low res side we have this vast effected/changed area as we bent all these pixels toward each other (both the black and the white) and have a huge swath of smoothing because we were only working at a low resolution.

On our High res side we have instead obtained a perfect balance set of pixels mixing together 4X pixels that makes a smaller smoothing area. so the High res side finds the pixels that would smooth this all out really pretty, but doesn't leave a big blurred up mess.

Because (again) we have to bend way more pixels , to maintain the balance of blending one to the other , If we up-scaled first we can create this bending blending at a smaller scale, still maintain the balance of bending one to the other, and the final result is less effected pixels, same jaggie hiding.

When you compare the 2 methods side by side using games, the difference that is achieved with what seems like a lot of extra work is not that much. Same thing when I am processing photos that will be used back at the lower res, it is a lot of extra effort for me and the machine, and the results are just barely better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.