Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Supersampling

From Wikipedia, the free encyclopedia
Spatial anti-aliasing method
Calculating the end color value
Comparison of a rendered scene without (left side) and with supersampling anti-aliasing applied (right) (Not applying AA is analogous to anearest-neighbor interpolation.)

Supersampling orsupersampling anti-aliasing (SSAA) is aspatial anti-aliasing method, i.e. a method used to removealiasing (jagged and pixelated edges, colloquially known as "jaggies") from imagesrendered incomputer games 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. Thesepixels 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)—hence the term "supersampling"—and an average color value is calculated. This can for example be achieved by rendering the image at a much higherresolution than the one being displayed, then shrinking it to the desired size, using the extra pixels for calculation, with the result being adownsampled image with smoother transitions from one line of pixels to another along the edges of objects, but each pixel could also be supersampled using other strategies (see theSupersampling patterns section). The number of samples determines the quality of theoutput.

Motivation

[edit]

Aliasing is manifested in the case of 2D images asmoiré pattern and pixelated edges, colloquially known as "jaggies".Commonsignal processing andimage processing knowledge suggests that to achieve perfect elimination ofaliasing, proper spatialsampling at theNyquist rate (or higher) after applying a 2DAnti-aliasing filter is required. As this approach would require a forward and inversefourier transformation, computationally less demanding approximations like supersampling were developed to avoid domain switches by staying in the spatial domain ("image domain").

Method

[edit]

Computational cost and adaptive supersampling

[edit]

Supersampling is computationally expensive because it requires much greatervideo cardmemory andmemory bandwidth, since the amount ofbuffer used is several times larger.[1] A way around this problem is to use a technique known asadaptive 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

[edit]

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.[1][2]

Grid

[edit]

The simplestalgorithm. 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

[edit]

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.[3]

Poisson disk

[edit]
Point samples generated using Poisson disk sampling, and graphical representation of the minimum inter-point distance
Not to be confused withPoisson sampling.

The Poisson disk sampling algorithm[4] 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 forreal-time rendering.[3] However, many fast algorithms now exist to generate Poisson disk noise, even those with variable density.[5][6][7] TheDelone set provides a mathematical description of such sampling.

Jittered

[edit]

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.[3]

Rotated grid

[edit]

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 isarctan (1/2) (about 26.6°) and the square is stretched by a factor of5/2[8][citation needed], making it also a4-queens solution.

See also

[edit]

References

[edit]
  1. ^ab"Anti-aliasing techniques comparison". sapphirenation.net. 2016-11-29. Retrieved2020-04-19.Generally speaking, SSAA provides exceptional image quality, but the performance hit is major here because the scene is rendered at a very high resolution.
  2. ^"What is supersampling?". everything2.com. 2004-05-20. Retrieved2020-04-19.
  3. ^abcAllen Sherrod (2008).Game Graphic Programming. Charles River Media. p. 336.ISBN 978-1584505167.
  4. ^Cook, R. L. (1986)."Stochastic sampling in computer graphics".ACM Transactions on Graphics.5 (1):51–72.doi:10.1145/7529.8927.S2CID 8551941.
  5. ^Dunbar, Daniel; Humphreys, Greg (2006)."A spatial data structure for fast Poisson-disk sample generation".ACM SIGGRAPH 2006 Papers on - SIGGRAPH '06. p. 503.doi:10.1145/1179352.1141915.ISBN 1595933646.S2CID 13954223. Retrieved7 January 2023.
  6. ^Bridson, Robert (2007)."Fast Poisson disk sampling in arbitrary dimensions"(PDF).ACM SIGGRAPH 2007 sketches. p. 22.doi:10.1145/1278780.1278807.ISBN 9781450347266.S2CID 3129455. Retrieved7 January 2023.
  7. ^Dwork, N; Baron, CA; Johnson, EMI; O'Connor, D; Pauly, JM; Larson, PEZ (April 2021)."Fast variable density Poisson-disc sample generation with directional variation for compressed sensing in MRI".Magnetic Resonance Imaging.77:186–193.doi:10.1016/j.mri.2020.11.012.PMC 7878411.PMID 33232767.
  8. ^"Super-sampling Anti-aliasing Analyzed"(PDF). Beyond3D.com. Retrieved2020-04-19.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Supersampling&oldid=1332725747"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp