Supersampling
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.
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
.
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.
. 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.
Aliasing
In signal processing and related disciplines, aliasing refers to an effect that causes different signals to become indistinguishable when sampled...
). It is a method of smoothing images rendered
Rendering (computer graphics)
Rendering is the process of generating an image from a model , by means of computer programs. A scene file contains objects in a strictly defined language or data structure; it would contain geometry, viewpoint, texture, lighting, and shading information as a description of the virtual scene...
in computer games
Computer Games
"Computer Games" is a single by New Zealand group, Mi-Sex released in 1979 in Australia and New Zealand and in 1981 throughout Europe. It was the single that launched the band, and was hugely popular, particularly in Australia and New Zealand...
or other programs that generate imagery.
Overview
Aliasing occurs because real-world objects have continuous, smooth curves and lines, whereas monitors can only display discrete points of light called pixels. Since pixels are uniformly colored and always of the same shape, 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
Display resolution
The display resolution of a digital television or display device is the number of distinct pixels in each dimension that can be displayed. It can be an ambiguous term especially as the displayed resolution is controlled by all different factors in cathode ray tube , flat panel or projection...
than the one being displayed, then downsampling
Downsampling
In signal processing, downsampling is the process of reducing the sampling rate of a signal. This is usually done to reduce the data rate or the size of the data....
(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
Output
Output is the term denoting either an exit or changes which exit a system and which activate/modify a process. It is an abstract concept, used in the modeling, system design and system exploitation.-In control theory:...
.
Computational cost and adaptive supersampling
Supersampling is computationally expensive because it requires much greater video cardVideo card
A video card, Graphics Card, or Graphics adapter is an expansion card which generates output images to a display. Most video cards offer various functions such as accelerated rendering of 3D scenes and 2D graphics, MPEG-2/MPEG-4 decoding, TV output, or the ability to connect multiple monitors...
memory
Memory
In psychology, memory is an organism's ability to store, retain, and recall information and experiences. Traditional studies of memory began in the fields of philosophy, including techniques of artificially enhancing memory....
and memory bandwidth
Memory bandwidth
Memory bandwidth is the rate at which data can be read from or stored into a semiconductor memory by a processor. Memory bandwidth is usually expressed in units of bytes/second, though this can vary for systems with natural data sizes that are not a multiple of the commonly used 8-bit bytes.Memory...
, since the amount of buffer
Buffer (computer science)
In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device or just before it is sent to an output device...
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.
Types of supersampling
There are several types of supersampling available, and all are variations on where the extra samples are taken inside the pixel.Grid
The simplest algorithmAlgorithm
In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. Algorithms are used for calculation, data processing, and automated reasoning...
. 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.
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.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.Jittered
A modification of the grid algorithm to approximate the Poisson disc. 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.Rotated grid
A 2×2 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.See also
- Multisample anti-aliasingMultisample Anti-AliasingMultisample anti-aliasing is a type of anti-aliasing, a technique used in computer graphics to improve image quality.- Definition :The term generally refers to a special case of supersampling. Initial implementations of full-scene anti-aliasing worked conceptually by simply rendering a scene at a...
- QuincunxQuincunxA quincunx is a geometric pattern consisting of five points arranged in a cross, that is five coplanar points, four of them forming a square or rectangle and a fifth at its center...
- Graphics card
- Graphics processing unitGraphics processing unitA graphics processing unit or GPU is a specialized circuit designed to rapidly manipulate and alter memory in such a way so as to accelerate the building of images in a frame buffer intended for output to a display...
- Ray tracing (graphics)
- FramebufferFramebufferA framebuffer is a video output device that drives a video display from a memory buffer containing a complete frame of data.The information in the memory buffer typically consists of color values for every pixel on the screen...
- Game engineGame engineA game engine is a system designed for the creation and development of video games. There are many game engines that are designed to work on video game consoles and personal computers...
- Image scalingImage scalingIn computer graphics, image scaling is the process of resizing a digital image. Scaling is a non-trivial process that involves a trade-off between efficiency, smoothness and sharpness. As the size of an image is increased, so the pixels which comprise the image become increasingly visible, making...
- 2xSaI