Supersampling
   HOME

TheInfoList



OR:

Supersampling or supersampling anti-aliasing (SSAA) is a
spatial anti-aliasing In digital signal processing, spatial anti-aliasing is a technique for minimizing the distortion artifacts (aliasing) when representing a high-resolution image at a lower resolution. Anti-aliasing is used in digital photography, computer graphics ...
method, i.e. a method used to remove
aliasing In signal processing and related disciplines, aliasing is a phenomenon that a reconstructed signal from samples of the original signal contains low frequency components that are not present in the original one. This is caused when, in the ori ...
(jagged and pixelated edges, colloquially known as "
jaggies Jaggies are artifacts in raster images, most frequently from aliasing, which in turn is often caused by non-linear mixing effects producing high-frequency components, or missing or poor anti-aliasing filtering prior to sampling. Jaggies are stai ...
") from images rendered in
computer games A video game or computer game is an electronic game that involves interaction with a user interface or input device (such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device) to generate visual fe ...
or other computer programs that generate imagery. Aliasing occurs because unlike real-world objects, which have continuous smooth curves and lines, a computer screen shows the viewer a large number of small squares. These
pixels In digital imaging, a pixel (abbreviated px), pel, or picture element is the smallest addressable element in a raster image, or the smallest addressable element in a dot matrix display device. In most digital display devices, pixels are the sma ...
all have the same size, and each one has a single color. A line can only be shown as a collection of pixels, and therefore appears jagged unless it is perfectly horizontal or vertical. The aim of supersampling is to reduce this effect. Color samples are taken at several instances inside the pixel (not just at the center as normal), 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 shrinking it to the desired size, using the extra pixels for calculation. The result is a
downsampled In digital signal processing, downsampling, compression, and decimation are terms associated with the process of sample rate conversion, ''resampling'' in a multi-rate digital signal processing system. Both ''downsampling'' and ''decimation'' can b ...
image with 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 may refer to: * The information produced by a computer, see Input/output * An output state of a system, see state (computer science) * Output (economics), the amount of goods and services produced ** Gross output in economics, the valu ...
.


Motivation

Aliasing In signal processing and related disciplines, aliasing is a phenomenon that a reconstructed signal from samples of the original signal contains low frequency components that are not present in the original one. This is caused when, in the ori ...
is manifested in the case of 2D images as
moiré pattern In mathematics, physics, and art, moiré patterns ( , , ) or moiré fringes are large-scale wave interference, interference patterns that can be produced when a partially opaque grating, ruled pattern with transparent gaps is overlaid on ano ...
and pixelated edges, colloquially known as "
jaggies Jaggies are artifacts in raster images, most frequently from aliasing, which in turn is often caused by non-linear mixing effects producing high-frequency components, or missing or poor anti-aliasing filtering prior to sampling. Jaggies are stai ...
". Common
signal processing Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, Scalar potential, potential fields, Seismic tomograph ...
and
image processing An image or picture is a visual representation. An image can be two-dimensional, such as a drawing, painting, or photograph, or three-dimensional, such as a carving or sculpture. Images may be displayed through other media, including a pr ...
knowledge suggests that to achieve perfect elimination of
aliasing In signal processing and related disciplines, aliasing is a phenomenon that a reconstructed signal from samples of the original signal contains low frequency components that are not present in the original one. This is caused when, in the ori ...
, proper spatial sampling at the
Nyquist rate In signal processing, the Nyquist rate, named after Harry Nyquist, is a value equal to twice the highest frequency ( bandwidth) of a given function or signal. It has units of samples per unit time, conventionally expressed as samples per se ...
(or higher) after applying a 2D Anti-aliasing filter is required. As this approach would require a forward and inverse fourier transformation, computationally less demanding approximations like supersampling were developed to avoid domain switches by staying in the spatial domain ("image domain").


Method


Computational cost and adaptive supersampling

Supersampling is computationally expensive because it requires much greater
video card A graphics card (also called a video card, display card, graphics accelerator, graphics adapter, VGA card/VGA, video adapter, display adapter, or colloquially GPU) is a computer expansion card that generates a feed of graphics output to a displa ...
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
and
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 ...
, since the amount of
buffer Buffer may refer to: Science * Buffer gas, an inert or nonflammable gas * Buffer solution, a solution used to prevent changes in pH * Lysis buffer, in cell biology * Metal ion buffer * Mineral redox buffer, in geology Technology and engineeri ...
used is several times larger. A way around this problem is to use a technique known as adaptive supersampling, where only pixels at the edges of objects are supersampled. Initially only a few samples are taken within each pixel. If these values are very similar, only these samples are used to determine the 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.


Supersampling patterns

When taking samples within a pixel, the sample positions have to be determined in some way. Although the number of ways in which this can be done is infinite, there are a few ways which are commonly used. File:Supersampling_-_Uniform.svg, Grid algorithm in uniform distribution File:Supersampling_-_Checker.svg, Rotated grid algorithm (with 2x times the sample density) File:Supersampling_-_Random.svg, Random algorithm File:Supersampling_-_Jittering.svg, Jitter algorithm File:Supersampling_-_Poisson_Disc.svg, Poisson disc algorithm File:Supersampling_-_QMC.svg,
Quasi-Monte Carlo method In numerical analysis, the quasi-Monte Carlo method is a method for numerical integration and solving some other problems using low-discrepancy sequences (also called quasi-random sequences or sub-random sequences) to achieve variance reduction. ...
algorithm File:Supersampling_-_N-Rooks.svg, N-Rooks File:Supersampling_-_RGSS.svg, RGSS File:Supersampling_-_Quincunx.svg, High-resolution antialiasing (HRAA),
Quincunx A quincunx ( ) is a geometry, geometric pattern consisting of five points arranged in a cross, with four of them forming a Square (geometry), square or rectangle and a fifth at its center. The same pattern has other names, including "in saltire" ...
File:Supersampling_-_Flipquad.svg, Flipquad File:Supersampling_-_Fliptri.svg, Fliptri


Grid

The simplest
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
. The pixel is split into 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 disk

The Poisson disk sampling algorithm places the samples randomly, but then checks that any two are not too close. The end result is an even but random distribution of samples. The naive "dart throwing" algorithm is extremely slow for large data sets, which once limited its applications for real-time rendering. However, many fast algorithms now exist to generate Poisson disk noise, even those with variable density. The
Delone set In the mathematical theory of metric spaces, -nets, -packings, -coverings, uniformly discrete sets, relatively dense sets, and Delone sets (named after Boris Delone) are several closely related definitions of well-spaced sets of points, and ...
provides a mathematical description of such sampling.


Jittered

A modification of the grid algorithm to approximate the Poisson disk. 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. For an optimal pattern, the rotation angle is (about 26.6°) and the square is stretched by a factor of , making it also a 4-queens solution.


See also

*
Oversampling In signal processing, oversampling is the process of sampling (signal processing), sampling a signal at a sampling frequency significantly higher than the Nyquist rate. Theoretically, a bandwidth-limited signal can be perfectly reconstructed if ...
*
Multisample anti-aliasing Multisample anti-aliasing (MSAA) is a type of spatial anti-aliasing, a technique used in computer graphics to remove jaggies. It is an optimization of supersampling, where only the necessary parts are sampled more. Jaggies are only noticed in ...
*
Quincunx A quincunx ( ) is a geometry, geometric pattern consisting of five points arranged in a cross, with four of them forming a Square (geometry), square or rectangle and a fifth at its center. The same pattern has other names, including "in saltire" ...
*
Graphics card A graphics card (also called a video card, display card, graphics accelerator, graphics adapter, VGA card/VGA, video adapter, display adapter, or colloquially GPU) is a computer expansion card that generates a feed of graphics output to a displa ...
*
Graphics processing unit A graphics processing unit (GPU) is a specialized electronic circuit designed for digital image processing and to accelerate computer graphics, being present either as a discrete video card or embedded on motherboards, mobile phones, personal ...
*
Ray tracing (graphics) In 3D computer graphics, ray tracing is a technique for modeling Light transport theory, light transport for use in a wide variety of Rendering (computer graphics), rendering algorithms for generating digital image, digital images. On a spectr ...
*
Framebuffer A framebuffer (frame buffer, or sometimes framestore) is a portion of random-access memory (RAM) containing a bitmap that drives a video display. It is a memory buffer containing data representing all the pixels in a complete video frame. Mode ...
*
Game engine A game engine is a software framework primarily designed for the development of video games which generally includes relevant libraries and support programs such as a level editor. The "engine" terminology is akin to the term " software engine" u ...
*
Image scaling In computer graphics and digital imaging, image scaling refers to the resizing of a digital image. In video technology, the magnification of digital material is known as upscaling or resolution enhancement. When scaling a vector graphic image ...
* 2×SaI *
Deep Learning Super Sampling Deep Learning Super Sampling (DLSS) is a suite of Real-time computing, real-time deep learning image enhancement and Image scaling, upscaling technologies developed by Nvidia that are available in a number of video games. The goal of these technol ...


References


External links

* * *{{cite journal , title=Image Interpolation with Contour Stencils , journal=Image Processing on Line , year=2011 , doi=10.5201/ipol.2011.g_iics , url=http://www.ipol.im/pub/art/2011/g_iics/ , accessdate=21 October 2010, last1=Getreuer , first1=Pascal , volume=1 , pages=70–82 , doi-access=free Image processing Anti-aliasing algorithms pl:Antyaliasing#Supersampling