Supersampling
From Wikipedia, the free encyclopedia
Supersampling is an antialiasing technique, the process of eliminating jagged and pixelated edges (aliasing). It is a method of smoothing images rendered in computer games or other programs that generate imagery.
Contents |
[edit] Overview
Aliasing occurs because real-world objects have continuous, smooth curves and lines. Monitors can only display discrete points of light called pixels. Since pixels are square and uniformly colored, lines become jagged.
Supersampling is one of the ways of solving this problem. Samples are taken at several instances inside the pixel (not just at the center as default) and an average color value is calculated. This is achieved by rendering the image at a much higher resolution than the one being displayed, then downsampling (shrinking) it to the desired size, using the extra pixels for calculation. The result is smoother transitions from one line of pixels to another along the edges of objects.
The number of samples determines the quality of the output. Options available normally range from 2x to 32x.
[edit] Computational cost and adaptive supersampling
Supersampling is computationally expensive because it requires a lot of video card memory and memory bandwidth, since the amount of buffer used is several times larger. A way around this problem is adaptive supersampling. This works by acknowledging that very few pixels will actually be on a boundary, therefore only these need to be supersampled.
At first only a few samples are made within a pixel. If these values are very similar, only these samples are used for determining color. If not, more are used. The result of this method is that a higher number of samples are calculated only where necessary, thus improving performance.
[edit] Types of supersampling
There are several types of supersampling available, and all are variations on where the extra samples are taken inside the pixel.
[edit] Grid
The simplest algorithm. The pixel is split in several sub-pixels, and a sample is taken from the center of each. It is fast and easy to implement, although due to the regular nature of sampling, aliasing can still occur if a low number of sub-pixels is used.
[edit] Random
Also known as Stochastic Sampling, it avoids the regularity of grid supersampling. However, due to the irregularity of the pattern, samples end up being unnecessary in some areas of the pixel and lacking in others.
[edit] Poisson Disc
Again an algorithm that places the samples randomly, but then checks that any two are not too close. End result is even but random distribution of samples. Unfortunately, the computational time required for this algorithm is too great to justify its use in real-time rendering.
[edit] Jittered
A combination of the grid algorithm and the Poisson disc (with regard to the end result). A pixel is split into several sub-pixels, but a sample is not taken from the center of each, but from a random point within the sub-pixel. Congregation can still occur, but to a lesser degree.
[edit] Rotated Grid
A 2x2 grid layout is used but the sample pattern is rotated to avoid samples aligning on the horizontal or vertical axis greatly improving antialiasing quality for the most commonly encountered cases.
[edit] See also
- Multisample anti-aliasing
- Quincunx
- Graphics card
- Graphics processing unit
- Ray tracing
- Framebuffer
- Game engine
- Image scaling
- 2xSaI
[edit] References
- High-Resolution Antialiasing (HRAA). Technical Brief: High-Resolution Antialiasing through Multisampling. Retrieved on May, 2006.
- What is supersampling (antialiasing technique)?. Hardware Knowledgebase. Retrieved on May, 2006.
- Supersampling. Everything2. Retrieved on May, 2006.