msaa la gi

From Wikipedia, the không tính phí encyclopedia

Multisample anti-aliasing (MSAA) is a type of spatial anti-aliasing, a technique used in computer graphics đồ sộ remove jaggies.

Bạn đang xem: msaa la gi

Definition[edit]

The term generally refers đồ sộ a special case of supersampling. Initial implementations of full-scene anti-aliasing (FSAA) worked conceptually by simply rendering a scene at a higher resolution, and then downsampling đồ sộ a lower-resolution output. Most modern GPUs are capable of this khuông of anti-aliasing, but it greatly taxes resources such as texture, bandwidth, and fillrate. (If a program is highly TCL-bound or CPU-bound, supersampling can be used without much performance hit.)

According đồ sộ the OpenGL GL_ARB_multisample specification,[1] "multisampling" refers đồ sộ a specific optimization of supersampling. The specification dictates that the renderer evaluate the fragment program once per px, and only "truly" supersample the depth and stencil values. (This is not the same as supersampling but, by the OpenGL 1.5 specification,[2] the definition had been updated đồ sộ include fully supersampling implementations as well.)

In graphics literature in general, "multisampling" refers đồ sộ any special case of supersampling where some components of the final image are not fully supersampled. The lists below refer specifically đồ sộ the ARB_multisample definition.

Description[edit]

In supersample anti-aliasing, multiple locations are sampled within every px, and each of those samples[3] is fully rendered and combined with the others đồ sộ produce the px that is ultimately displayed. This is computationally expensive, because the entire rendering process must be repeated for each sample location. It is also inefficient, as aliasing is typically only noticed in some parts of the image, such as the edges, whereas supersampling is performed for every single px.

In multisample anti-aliasing, if any of the multi sample locations in a px is covered by the triangle being rendered, a shading computation must be performed for that triangle. However this calculation only needs đồ sộ be performed once for the whole px regardless of how many sample positions are covered; the result of the shading calculation is simply applied đồ sộ all of the relevant multi sample locations.

In the case where only one triangle covers every multi sample location within the px, only one shading computation is performed, and these pixels are little more expensive (and the result is no different) than vãn in the non-anti-aliased image. This is true of the middle of triangles, where aliasing is not an issue. (Edge detection can reduce this further by explicitly limiting the MSAA calculation đồ sộ pixels whose samples involve multiple triangles, or triangles at multiple depths.) In the extreme case where each of the multi sample locations is covered by a different triangle, a different shading computation will be performed for each location and the results then combined đồ sộ give the final px, and the result and computational expense are the same as in the equivalent supersampled image.

The shading calculation is not the only operation that must be performed on a given pixel; multisampling implementations may variously sample other operations such as visibility at different sampling levels.

Advantages[edit]

  • The px shader usually only needs đồ sộ be evaluated once per px for every triangle covering at least one sample point.
  • The edges of polygons (the most obvious source of aliasing in 3 chiều graphics) are anti-aliased.
  • Since multiple subpixels per px are sampled, polygonal details smaller than vãn one px that might have been missed without MSAA can be captured and made a part of the final rendered image if enough samples are taken.

Disadvantages[edit]

Alpha testing[edit]

Alpha testing is a technique common đồ sộ older đoạn phim games used đồ sộ render translucent objects by rejecting pixels from being written đồ sộ the framebuffer.[4] If the alpha value of a translucent fragment (pixel) is below a specified threshold, it will be discarded. Because this is performed on a px by px basis, the image does not receive the benefits of multi-sampling (all of the multisamples in a px are discarded based on the alpha test) for these pixels. The resulting image may contain aliasing along the edges of transparent objects or edges within textures, although the image quality will be no worse than vãn it would be without any anti-aliasing.[5] Translucent objects that are modelled using alpha-test textures will also be aliased due đồ sộ alpha testing. This effect can be minimized by rendering objects with transparent textures multiple times, although this would result in a high performance reduction for scenes containing many transparent objects.[6]

Xem thêm: truyện ngắn ngôn tình hay

Aliasing[edit]

Because multi-sampling calculates interior polygon fragments only once per px, aliasing and other artifacts will still be visible inside rendered polygons where fragment shader output contains high frequency components.

Performance[edit]

While less performance-intensive than vãn SSAA (supersampling), it is possible in certain scenarios (scenes heavy in complex fragments) for MSAA đồ sộ be multiple times more intensive for a given frame than vãn post processing anti-aliasing techniques such as FXAA, SMAA and MLAA. Early techniques in this category tend towards a lower performance impact, but suffer from accuracy problems.[7] More recent post-processing based anti-aliasing techniques such as temporal anti-aliasing (TAA), which reduces aliasing by combining data from previously rendered frames, have seen the reversal of this trend, as post-processing AA becomes both more versatile and more expensive than vãn MSAA, which cannot antialias an entire frame alone.

Sampling methods[edit]

Point sampling[edit]

In a point-sampled mask, the coverage bit for each multisample is only phối if the multisample is located inside the rendered primitive. Samples are never taken from outside a rendered primitive, sánh images produced using point-sampling will be geometrically correct, but filtering quality may be low because the proportion of bits phối in the pixel's coverage mask may not be equal đồ sộ the proportion of the px that is actually covered by the fragment in question.

Area sampling[edit]

Filtering quality can be improved by using area sampled masks. In this method, the number of bits phối in a coverage mask for a px should be proportionate đồ sộ the actual area coverage of the fragment. This will result in some coverage bits being phối for multisamples that are not actually located within the rendered primitive, and can cause aliasing and other artifacts.

Sample patterns[edit]

Regular grid[edit]

A regular grid sample pattern, where multisample locations khuông an evenly spaced grid throughout the px, is easy đồ sộ implement and simplifies attribute evaluation (i.e. setting subpixel masks, sampling color and depth). This method is computationally expensive due đồ sộ the large number of samples. Edge optimization is poor for screen-aligned edges, but image quality is good when the number of multisamples is large.

Sparse regular grid[edit]

A sparse regular grid sample pattern is a subset of samples that are chosen from the regular grid sample pattern. As with the regular grid, attribute evaluation is simplified due đồ sộ regular spacing. The method is less computationally expensive due đồ sộ having a fewer samples. Edge optimization is good for screen aligned edges, and image quality is good for a moderate number of multisamples.

Xem thêm: khe hở hạnh phúc

Stochastic sample patterns[edit]

A stochastic sample pattern is a random distribution of multisamples throughout the px. The irregular spacing of samples makes attribute evaluation complicated. The method is cost efficient due đồ sộ low sample count (compared đồ sộ regular grid patterns). Edge optimization with this method, although sub-optimal for screen aligned edges. Image quality is excellent for a moderate number of samples.

Quality[edit]

Compared đồ sộ supersampling, multisample anti-aliasing can provide similar quality at higher performance, or better quality for the same performance. Further improved results can be achieved by using rotated grid subpixel masks. The additional bandwidth required by multi-sampling is reasonably low if Z and colour compression are available.[8]

Most modern GPUs tư vấn 2×, 4×, and 8× MSAA samples. Higher values result in better quality, but are slower.

See also[edit]

  • Alpha đồ sộ coverage
  • Morphological antialiasing

References[edit]